From 00ad39a6000f5bfcdddbfb5accb9b165e997b963 Mon Sep 17 00:00:00 2001 From: odonos12 Date: Wed, 25 Nov 2020 13:20:51 +0000 Subject: [PATCH] PowerMax Driver - Fix assign SRP during promotion retype SRP is not assigned during failover-promotion retype. In cases where SRP is different between primary and remote arrays this can lead to issues once failover-promotion is finalized. Fixed by adding SRP assignment when generating volume's model update. Change-Id: Id0500c2f85974818fa2a841c9dca77f1fef4df04 Closes-Bug: 1905564 --- .../drivers/dell_emc/powermax/test_powermax_replication.py | 6 ++++-- cinder/volume/drivers/dell_emc/powermax/common.py | 2 ++ releasenotes/notes/bug-1905564-e7dcf28fd734d3b2.yaml | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/bug-1905564-e7dcf28fd734d3b2.yaml diff --git a/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_replication.py b/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_replication.py index fab53262560..43cc3144a91 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_replication.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_replication.py @@ -1186,15 +1186,16 @@ class PowerMaxReplicationTest(test.TestCase): return_value=(True, tpd.PowerMaxData.defaultstoragegroup_name)) def test_migrate_volume_success_rep_promotion( self, mck_retype, mck_get, mck_break, mck_valid): - array_id = self.data.array + array_id = self.data.remote_array volume = self.data.test_rep_volume device_id = self.data.device_id - srp = self.data.srp + srp = 'SRP_2' target_slo = self.data.slo_silver target_workload = self.data.workload volume_name = volume.name new_type = {'extra_specs': {}} extra_specs = self.data.rep_extra_specs_rep_config + updated_host = 'HostX@Backend#Diamond+DSS+SRP_2+000197800124' self.common.promotion = True target_extra_specs = { utils.SRP: srp, utils.ARRAY: array_id, utils.SLO: target_slo, @@ -1205,6 +1206,7 @@ class PowerMaxReplicationTest(test.TestCase): success, model_update = self.common._migrate_volume( array_id, volume, device_id, srp, target_slo, target_workload, volume_name, new_type, extra_specs) + self.assertEqual(model_update['host'], updated_host) mck_break.assert_called_once_with( array_id, device_id, volume_name, extra_specs) mck_retype.assert_called_once_with( diff --git a/cinder/volume/drivers/dell_emc/powermax/common.py b/cinder/volume/drivers/dell_emc/powermax/common.py index 2403ca9559c..1ea9e4f9e84 100644 --- a/cinder/volume/drivers/dell_emc/powermax/common.py +++ b/cinder/volume/drivers/dell_emc/powermax/common.py @@ -4086,7 +4086,9 @@ class PowerMaxCommon(object): previous_host = volume.get('host') host_details = previous_host.split('+') array_index = len(host_details) - 1 + srp_index = len(host_details) - 2 host_details[array_index] = array + host_details[srp_index] = srp updated_host = '+'.join(host_details) model_update['host'] = updated_host diff --git a/releasenotes/notes/bug-1905564-e7dcf28fd734d3b2.yaml b/releasenotes/notes/bug-1905564-e7dcf28fd734d3b2.yaml new file mode 100644 index 00000000000..a8c1ad84023 --- /dev/null +++ b/releasenotes/notes/bug-1905564-e7dcf28fd734d3b2.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + PowerMax Driver `bug #1905564 + `_: Fix + Fix remote SRP not being assigned to volume's Host when + performing retype during failover-promotion.