From cefba8640842ab9cb479533be24688ae62d7e9bb Mon Sep 17 00:00:00 2001 From: Venkata Krishna Date: Fri, 17 Sep 2021 16:19:57 +0000 Subject: [PATCH] [SVF] Fix rccg and relationship creation issues [Spectrum Virtualize Family] Fix issues while creating a mirror volume and creating a group by using the storage backend system_id in the place of system_name in create_relationship and create_rccg calls to choose the correct partnership based on the system_id. This issue occurs when multiple partnerships in different states are available for the same storage system_name. Closes-Bug: #1939145 Change-Id: I9391a1a07aac00a3f80bf19cd4887bdfbec78b20 --- cinder/tests/unit/volume/drivers/ibm/test_storwize_svc.py | 6 +++--- cinder/volume/drivers/ibm/storwize_svc/replication.py | 4 ++-- .../drivers/ibm/storwize_svc/storwize_svc_common.py | 4 ++-- ...-issue-with-multiple-partnership-c437ebbb511879b9.yaml | 8 ++++++++ 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/bug-1939145-ibm-svf-fix-systemname-issue-with-multiple-partnership-c437ebbb511879b9.yaml diff --git a/cinder/tests/unit/volume/drivers/ibm/test_storwize_svc.py b/cinder/tests/unit/volume/drivers/ibm/test_storwize_svc.py index cd919107279..7afbc645b7f 100644 --- a/cinder/tests/unit/volume/drivers/ibm/test_storwize_svc.py +++ b/cinder/tests/unit/volume/drivers/ibm/test_storwize_svc.py @@ -2096,7 +2096,7 @@ port_speed!N/A if 'cluster' not in kwargs: return self._errors['CMMVC5707E'] aux_cluster = kwargs['cluster'].strip('\'\"') - if aux_cluster != aux_sys['name']: + if aux_cluster != aux_sys['id']: return self._errors['CMMVC5754E'] if (self._volumes_list[master_vol]['capacity'] != @@ -2438,8 +2438,8 @@ port_speed!N/A if 'cluster' not in kwargs: return self._errors['CMMVC5707E'] aux_cluster = kwargs['cluster'].strip('\'\"') - if (aux_cluster != aux_sys['name'] and - aux_cluster != master_sys['name']): + if (aux_cluster != aux_sys['id'] and + aux_cluster != master_sys['id']): return self._errors['CMMVC5754E'] rccg_info = {} diff --git a/cinder/volume/drivers/ibm/storwize_svc/replication.py b/cinder/volume/drivers/ibm/storwize_svc/replication.py index dcb84b80c97..2437397d58c 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/replication.py +++ b/cinder/volume/drivers/ibm/storwize_svc/replication.py @@ -111,7 +111,7 @@ class StorwizeSVCReplicationGlobalMirror(StorwizeSVCReplication): system_info = self.target_helpers.get_system_info() self.driver._helpers.create_relationship( - vref['name'], target_vol_name, system_info.get('system_name'), + vref['name'], target_vol_name, system_info.get('system_id'), self.asyncmirror) except Exception as e: msg = (_("Unable to set up mirror mode replication for %(vol)s. " @@ -234,7 +234,7 @@ class StorwizeSVCReplicationGMCV(StorwizeSVCReplicationGlobalMirror): vref['volume_type_id']) cycle_period_seconds = src_change_opts.get('cycle_period_seconds') self.driver._helpers.create_relationship( - vref['name'], target_vol_name, system_info.get('system_name'), + vref['name'], target_vol_name, system_info.get('system_id'), self.asyncmirror, True, source_change_vol_name, cycle_period_seconds) # Set target change volume diff --git a/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py b/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py index a2e95c5128a..016e9c72d37 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py +++ b/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py @@ -5891,7 +5891,7 @@ class StorwizeSVCCommonDriver(san.SanDriver, try: tgt_sys = self._aux_backend_helpers.get_system_info() self._helpers.create_rccg( - rccg_name, tgt_sys.get('system_name')) + rccg_name, tgt_sys.get('system_id')) model_update.update({'replication_status': fields.ReplicationStatus.ENABLED}) except exception.VolumeBackendAPIException as err: @@ -6070,7 +6070,7 @@ class StorwizeSVCCommonDriver(san.SanDriver, try: tgt_sys = self._aux_backend_helpers.get_system_info() self._helpers.create_rccg(rccg_name, - tgt_sys.get('system_name')) + tgt_sys.get('system_id')) model_update.update({'replication_status': fields.ReplicationStatus.ENABLED}) except exception.VolumeBackendAPIException as err: diff --git a/releasenotes/notes/bug-1939145-ibm-svf-fix-systemname-issue-with-multiple-partnership-c437ebbb511879b9.yaml b/releasenotes/notes/bug-1939145-ibm-svf-fix-systemname-issue-with-multiple-partnership-c437ebbb511879b9.yaml new file mode 100644 index 00000000000..6337032bcda --- /dev/null +++ b/releasenotes/notes/bug-1939145-ibm-svf-fix-systemname-issue-with-multiple-partnership-c437ebbb511879b9.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + IBM Spectrum Virtualize Family driver + `Bug #1939145 `_: + Updating create_relationship and create_rccg calls with the + system_id in the place of system_name to fix the issues while + creating a mirror volume or creating a consistency group.