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
(cherry picked from commit 50fc5e3988)
This commit is contained in:
odonos12 2020-04-24 12:27:54 +01:00 committed by Helen Walsh
parent 13e45234bf
commit 9561882bdf
6 changed files with 34 additions and 3 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):

View File

@ -124,9 +124,10 @@ class PowerMaxFCDriver(san.SanDriver, driver.FibreChannelDriver):
- Pools bug fix allowing 'None' variants (bug #1873253)
4.2.1 - Concurrent live migrations failure (bug #1875478)
4.2.2 - U4P failover lock not released on exception (#1875640)
4.2.3 - Live migrate remove rep vol from sg (bug #1875432)
"""
VERSION = "4.2.2"
VERSION = "4.2.3"
# ThirdPartySystems wiki
CI_WIKI_NAME = "EMC_VMAX_CI"

View File

@ -129,9 +129,10 @@ class PowerMaxISCSIDriver(san.SanISCSIDriver):
- Pools bug fix allowing 'None' variants (bug #1873253)
4.2.1 - Concurrent live migrations failure (bug #1875478)
4.2.2 - U4P failover lock not released on exception (#1875640)
4.2.3 - Live migrate remove rep vol from sg (bug #1875432)
"""
VERSION = "4.2.2"
VERSION = "4.2.3"
# ThirdPartySystems wiki
CI_WIKI_NAME = "EMC_VMAX_CI"