PowerMax Driver - Live migrate remove rep vol from sg

Adding missing force flag during live migration of instance
with more than one replication device in its masking view.
The removal of replication enabled devices from storage groups
is blocked in certain cases and an additional force option
is required in the REST payload.

Closes-Bug: 1875432
Change-Id: Ieae62e12df3be5018f716225abb65cdaa78379d1
This commit is contained in:
odonos12 2020-04-24 12:27:54 +01:00
parent 595b8adc44
commit 50fc5e3988
4 changed files with 30 additions and 1 deletions

View File

@ -138,7 +138,8 @@ class PowerMaxData(object):
'is_multipath': True,
'array': array,
'controller': {'host': '10.00.00.00'},
'hostlunid': 3}
'hostlunid': 3,
'device_id': device_id}
iscsi_device_info_metro = deepcopy(iscsi_device_info)
iscsi_device_info_metro['metro_ip_and_iqn'] = [{'ip': ip2, 'iqn': iqn2}]
iscsi_device_info_metro['metro_hostlunid'] = 2

View File

@ -543,6 +543,32 @@ class PowerMaxCommonTest(test.TestCase):
self.assertEqual(0, mck_remove.call_count)
self.assertEqual(1, mck_info.call_count)
@mock.patch.object(provision.PowerMaxProvision, 'verify_slo_workload')
@mock.patch.object(common.PowerMaxCommon, '_remove_members')
@mock.patch.object(common.PowerMaxCommon, 'find_host_lun_id',
return_value=(tpd.PowerMaxData.iscsi_device_info,
False))
@mock.patch.object(
common.PowerMaxCommon, '_get_replication_extra_specs',
return_value=tpd.PowerMaxData.rep_extra_specs_rep_config)
@mock.patch.object(
common.PowerMaxCommon, '_initial_setup',
return_value=tpd.PowerMaxData.rep_extra_specs_rep_config)
def test_unmap_lun_replication_force_flag(
self, mck_setup, mck_rep, mck_find, mck_rem, mck_slo):
volume = deepcopy(self.data.test_volume)
connector = deepcopy(self.data.connector)
device_info = self.data.provider_location['device_id']
volume.volume_attachment.objects = [
deepcopy(self.data.test_volume_attachment)]
extra_specs = deepcopy(self.data.rep_extra_specs_rep_config)
array = extra_specs[utils.ARRAY]
extra_specs[utils.FORCE_VOL_REMOVE] = True
self.common._unmap_lun(volume, connector)
mck_rem.assert_called_once_with(array, volume, device_info,
extra_specs, connector, False,
async_grp=None, host_template=None)
def test_initialize_connection_already_mapped(self):
volume = self.data.test_volume
connector = self.data.connector

View File

@ -106,6 +106,7 @@ class PowerMaxReplicationTest(test.TestCase):
extra_specs = deepcopy(self.extra_specs)
extra_specs[utils.PORTGROUPNAME] = self.data.port_group_name_f
extra_specs[utils.IS_RE] = True
extra_specs[utils.FORCE_VOL_REMOVE] = True
rep_config = self.data.rep_config_sync
rep_config[utils.RDF_CONS_EXEMPT] = False
extra_specs[utils.REP_CONFIG] = rep_config

View File

@ -751,6 +751,7 @@ class PowerMaxCommon(object):
backend_id = self._get_replicated_volume_backend_id(volume)
rep_config = self.utils.get_rep_config(
backend_id, self.rep_configs)
extra_specs[utils.FORCE_VOL_REMOVE] = True
rep_extra_specs = self._get_replication_extra_specs(
extra_specs, rep_config)
if self.utils.is_volume_failed_over(volume):