From 8615ce254902b22385b75c3a6158a0dfd0db8785 Mon Sep 17 00:00:00 2001 From: Kiran Pawar Date: Tue, 3 Oct 2023 12:17:51 +0000 Subject: [PATCH] NetApp Derive vserver name from share server identifier Instead of using the identifier the migration methods are deriving the vserver name from the share server id. This causes failure for migrate a share server that had been migrated before. Closes-bug: #2037109 Change-Id: Ida13bacab960761bb7cd0708017d864db0d7358f --- .../netapp/dataontap/cluster_mode/lib_multi_svm.py | 4 ++-- manila/tests/share/drivers/netapp/dataontap/fakes.py | 1 + ...ve-vserver-name-during-migration-81fd7d24b36b4dbe.yaml | 8 ++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/bug-2037109-netapp-use-identifier-to-derive-vserver-name-during-migration-81fd7d24b36b4dbe.yaml diff --git a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_multi_svm.py b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_multi_svm.py index c89b5e0ee3..504870f237 100644 --- a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_multi_svm.py +++ b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_multi_svm.py @@ -1266,7 +1266,7 @@ class NetAppCmodeMultiSVMFileStorageLibrary( if (dest_client.is_svm_migrate_supported() and src_client.is_svm_migrate_supported()): source_share_server_name = self._get_vserver_name( - source_share_server['id']) + source_share_server['identifier']) # Check if the migration is supported. try: @@ -1505,7 +1505,7 @@ class NetAppCmodeMultiSVMFileStorageLibrary( # Prepare the migration request. src_cluster_name = src_client.get_cluster_name() source_share_server_name = self._get_vserver_name( - source_share_server['id']) + source_share_server['identifier']) # 3. Send the migration request to ONTAP. try: diff --git a/manila/tests/share/drivers/netapp/dataontap/fakes.py b/manila/tests/share/drivers/netapp/dataontap/fakes.py index 4181d11b78..e80fe0455f 100644 --- a/manila/tests/share/drivers/netapp/dataontap/fakes.py +++ b/manila/tests/share/drivers/netapp/dataontap/fakes.py @@ -571,6 +571,7 @@ NETWORK_INFO_NETMASK = '255.255.255.0' SHARE_SERVER = { 'id': 'fake_id', 'share_network_id': 'c5b3a865-56d0-4d88-abe5-879965e099c9', + 'identifier': 'fake_id', 'backend_details': { 'vserver_name': VSERVER1 }, diff --git a/releasenotes/notes/bug-2037109-netapp-use-identifier-to-derive-vserver-name-during-migration-81fd7d24b36b4dbe.yaml b/releasenotes/notes/bug-2037109-netapp-use-identifier-to-derive-vserver-name-during-migration-81fd7d24b36b4dbe.yaml new file mode 100644 index 0000000000..d2f3860db0 --- /dev/null +++ b/releasenotes/notes/bug-2037109-netapp-use-identifier-to-derive-vserver-name-during-migration-81fd7d24b36b4dbe.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + NetApp ONTAP driver during migration uses share server id which was causing + failure for migrate a share server that had been migrated before. Fixed it + by using share server identifier instead of id. Please refer to the + `Launchpad bug #2037109 `_ + for more details.