From 65c9f6f4a21cc9689e6ad1d02a1e641cdb51f1b5 Mon Sep 17 00:00:00 2001 From: Felipe Rodrigues Date: Thu, 24 Sep 2020 12:22:20 +0000 Subject: [PATCH] [NetApp] Fix access rules for CIFS promoted replica This patch fixes the access rules for NetApp promote replica when using CIFS protocol. When promoting a replica, the NetApp ONTAP driver updates the access rules for the promoted CIFS share entity before actually creating it, failing on having those rules applied. The bug is fixed by switching the order of updating the access and creating the promoted CIFS share entity. Change-Id: I60e4057dc962d96cff57dea88587a28c2043b499 Closes-Bug: #1896949 (cherry picked from commit 0c4d1e339801bb9d346dfa5a29af2ab76517bbd7) (cherry picked from commit c857b94e8a8aae1f471ebbde8b49beaad41ef431) (cherry picked from commit 460f44704df3303e092de3e9781224fdbbe8502d) --- .../drivers/netapp/dataontap/cluster_mode/lib_base.py | 5 +++-- ...ifs-access-rules-promoted-replica-70b32991cc90e1ca.yaml | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/1896949-netapp-fix-cifs-access-rules-promoted-replica-70b32991cc90e1ca.yaml diff --git a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py index 5192178b8d..a9a0da7c98 100644 --- a/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py +++ b/manila/share/drivers/netapp/dataontap/cluster_mode/lib_base.py @@ -1822,6 +1822,9 @@ class NetAppCmodeFileStorageLibrary(object): # 3. Setup access rules new_active_replica = replica.copy() + new_active_replica['export_locations'] = self._create_export( + new_active_replica, share_server, vserver, vserver_client) + helper = self._get_helper(replica) helper.set_client(vserver_client) try: @@ -1832,8 +1835,6 @@ class NetAppCmodeFileStorageLibrary(object): else: new_active_replica['access_rules_status'] = constants.STATUS_ACTIVE - new_active_replica['export_locations'] = self._create_export( - new_active_replica, share_server, vserver, vserver_client) new_active_replica['replica_state'] = constants.REPLICA_STATE_ACTIVE # 4. Set File system size fixed to false diff --git a/releasenotes/notes/1896949-netapp-fix-cifs-access-rules-promoted-replica-70b32991cc90e1ca.yaml b/releasenotes/notes/1896949-netapp-fix-cifs-access-rules-promoted-replica-70b32991cc90e1ca.yaml new file mode 100644 index 0000000000..e82abb9d95 --- /dev/null +++ b/releasenotes/notes/1896949-netapp-fix-cifs-access-rules-promoted-replica-70b32991cc90e1ca.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixed an issue on ONTAP NetApp driver that caused access rules not to be + applied to a promoted replica using CIFS protocol. Please refer to the + `Launchpad bug #1896949 `_ + for more details.