Merge "NEC driver: fix live-migration failure with FC" into stable/train
This commit is contained in:
commit
73ba22632b
|
@ -210,6 +210,17 @@ xml_out = '''
|
||||||
<UNIT name="RPL Attribute">IV</UNIT>
|
<UNIT name="RPL Attribute">IV</UNIT>
|
||||||
</SECTION>
|
</SECTION>
|
||||||
</OBJECT>
|
</OBJECT>
|
||||||
|
<OBJECT name="Logical Disk">
|
||||||
|
<SECTION name="LD Detail Information">
|
||||||
|
<UNIT name="LDN(h)">0011</UNIT>
|
||||||
|
<UNIT name="OS Type">LX</UNIT>
|
||||||
|
<UNIT name="LD Name">6EWPOChJkdSysJmpMAB9YR</UNIT>
|
||||||
|
<UNIT name="LD Capacity">6442450944</UNIT>
|
||||||
|
<UNIT name="Pool No.(h)">0001</UNIT>
|
||||||
|
<UNIT name="Purpose">---</UNIT>
|
||||||
|
<UNIT name="RPL Attribute">IV</UNIT>
|
||||||
|
</SECTION>
|
||||||
|
</OBJECT>
|
||||||
<OBJECT name="Logical Disk">
|
<OBJECT name="Logical Disk">
|
||||||
<SECTION name="LD Detail Information">
|
<SECTION name="LD Detail Information">
|
||||||
<UNIT name="LDN(h)">0fff</UNIT>
|
<UNIT name="LDN(h)">0fff</UNIT>
|
||||||
|
@ -330,6 +341,26 @@ xml_out = '''
|
||||||
<UNIT name="LUN(h)">0001</UNIT>
|
<UNIT name="LUN(h)">0001</UNIT>
|
||||||
<UNIT name="LDN(h)">0006</UNIT>
|
<UNIT name="LDN(h)">0006</UNIT>
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
<SECTION name="LUN/LD List">
|
||||||
|
<UNIT name="LUN(h)">0002</UNIT>
|
||||||
|
<UNIT name="LDN(h)">0011</UNIT>
|
||||||
|
</SECTION>
|
||||||
|
</OBJECT>
|
||||||
|
<OBJECT name="LD Set(FC)">
|
||||||
|
<SECTION name="LD Set(FC) Information">
|
||||||
|
<UNIT name="Platform">LX</UNIT>
|
||||||
|
<UNIT name="LD Set Name">OpenStack3</UNIT>
|
||||||
|
</SECTION>
|
||||||
|
<SECTION name="Path List">
|
||||||
|
<UNIT name="Path">1000-0090-FAA0-786D</UNIT>
|
||||||
|
</SECTION>
|
||||||
|
<SECTION name="Path List">
|
||||||
|
<UNIT name="Path">1000-0090-FAA0-786C</UNIT>
|
||||||
|
</SECTION>
|
||||||
|
<SECTION name="LUN/LD List">
|
||||||
|
<UNIT name="LUN(h)">0001</UNIT>
|
||||||
|
<UNIT name="LDN(h)">0011</UNIT>
|
||||||
|
</SECTION>
|
||||||
</OBJECT>
|
</OBJECT>
|
||||||
<OBJECT name="LD Set(iSCSI)">
|
<OBJECT name="LD Set(iSCSI)">
|
||||||
<SECTION name="LD Set(iSCSI) Information">
|
<SECTION name="LD Set(iSCSI) Information">
|
||||||
|
@ -1032,6 +1063,37 @@ class ExportTest(volume_helper.MStorageDSVDriver, test.TestCase):
|
||||||
self._fc_terminate_connection(vol, connector)
|
self._fc_terminate_connection(vol, connector)
|
||||||
delldsetld_mock.assert_not_called()
|
delldsetld_mock.assert_not_called()
|
||||||
|
|
||||||
|
vol = fake_volume_obj(ctx, id='ccd662e5-2efe-4899-b12f-114b5cad81c3')
|
||||||
|
connector = {'wwpns': ["10000090FAA0786A", "10000090FAA0786B"],
|
||||||
|
'host': 'HostA'}
|
||||||
|
atchmnt = {
|
||||||
|
'id': constants.ATTACHMENT_ID,
|
||||||
|
'volume_id': vol.id,
|
||||||
|
'connector': connector
|
||||||
|
}
|
||||||
|
attach_object = volume_attachment.VolumeAttachment(**atchmnt)
|
||||||
|
attachment = volume_attachment.VolumeAttachmentList(
|
||||||
|
objects=[attach_object])
|
||||||
|
vol.volume_attachment = attachment
|
||||||
|
|
||||||
|
info = self._fc_initialize_connection(vol, connector)
|
||||||
|
self.assertEqual(2, info['data']['target_lun'])
|
||||||
|
|
||||||
|
connector = {'wwpns': ["10000090FAA0786C", "10000090FAA0786D"],
|
||||||
|
'host': 'HostB'}
|
||||||
|
atchmnt = {
|
||||||
|
'id': constants.ATTACHMENT_ID,
|
||||||
|
'volume_id': vol.id,
|
||||||
|
'connector': connector
|
||||||
|
}
|
||||||
|
attach_object = volume_attachment.VolumeAttachment(**atchmnt)
|
||||||
|
attachment = volume_attachment.VolumeAttachmentList(
|
||||||
|
objects=[attach_object])
|
||||||
|
vol.volume_attachment = attachment
|
||||||
|
|
||||||
|
info = self._fc_initialize_connection(vol, connector)
|
||||||
|
self.assertEqual(1, info['data']['target_lun'])
|
||||||
|
|
||||||
def test_fc_terminate_connection(self):
|
def test_fc_terminate_connection(self):
|
||||||
ctx = context.RequestContext('admin', 'fake', True)
|
ctx = context.RequestContext('admin', 'fake', True)
|
||||||
vol = fake_volume_obj(ctx, id='46045673-41e7-44a7-9333-02f07feab04b')
|
vol = fake_volume_obj(ctx, id='46045673-41e7-44a7-9333-02f07feab04b')
|
||||||
|
@ -1243,7 +1305,12 @@ class NonDisruptiveBackup_test(volume_helper.MStorageDSVDriver,
|
||||||
'protocol': 'FC',
|
'protocol': 'FC',
|
||||||
'wwpn': ['1000-0090-FAA0-786A', '1000-0090-FAA0-786B'],
|
'wwpn': ['1000-0090-FAA0-786A', '1000-0090-FAA0-786B'],
|
||||||
'port': []}
|
'port': []}
|
||||||
return_ldset = [ldset_lds0, ldset_lds1]
|
ldset_lds2 = {'ldsetname': 'LX:OpenStack1',
|
||||||
|
'lds': {6: {'ldn': 6, 'lun': 1}},
|
||||||
|
'protocol': 'FC',
|
||||||
|
'wwpn': ['1000-0090-FAA0-786A', '1000-0090-FAA0-786B'],
|
||||||
|
'port': []}
|
||||||
|
return_ldset = [ldset_lds0, ldset_lds1, ldset_lds2]
|
||||||
self.mock_object(self, '_validate_fcldset_exist',
|
self.mock_object(self, '_validate_fcldset_exist',
|
||||||
side_effect=return_ldset)
|
side_effect=return_ldset)
|
||||||
mocker = self.mock_object(self._cli, 'addldsetld',
|
mocker = self.mock_object(self._cli, 'addldsetld',
|
||||||
|
|
|
@ -1278,15 +1278,11 @@ class MStorageDriver(volume_common.MStorageVolumeCommon):
|
||||||
else:
|
else:
|
||||||
ldn = lds[ldname]['ldn']
|
ldn = lds[ldname]['ldn']
|
||||||
|
|
||||||
lun = None
|
ldset = self._validate_fcldset_exist(ldsets, connector)
|
||||||
for ldset in ldsets.values():
|
|
||||||
if ldn in ldset['lds']:
|
|
||||||
lun = ldset['lds'][ldn]['lun']
|
|
||||||
break
|
|
||||||
|
|
||||||
info = {
|
info = {
|
||||||
'driver_volume_type': 'fibre_channel',
|
'driver_volume_type': 'fibre_channel',
|
||||||
'data': {'target_lun': lun,
|
'data': {'target_lun': ldset['lds'][ldn]['lun'],
|
||||||
'target_wwn': target_wwns,
|
'target_wwn': target_wwns,
|
||||||
'initiator_target_map': init_targ_map}}
|
'initiator_target_map': init_targ_map}}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
`Bug #1887908 <https://bugs.launchpad.net/cinder/+bug/1887908>`_:
|
||||||
|
In NEC driver, fix live-migration failure with FC.
|
||||||
|
|
Loading…
Reference in New Issue