From 8e1d5b4aeb5c4bbae9039a8602f5725dddeb59bd Mon Sep 17 00:00:00 2001 From: Simon Dodsley Date: Sat, 29 Jul 2023 09:51:51 -0400 Subject: [PATCH] [Pure Storage] Uniform Sync Replication disconnect When a sync replicated volume is disconnected, the host connection on the secondary array is not correctly removed. This patch resolves that by ensuring the remote host connections are also removed before the final disconnection of the volume from the host. Closes-Bug: #2029005 Change-Id: If1c08e918710b809ec62612e77740131914e2233 --- cinder/tests/unit/volume/drivers/test_pure.py | 2 +- cinder/volume/drivers/pure.py | 4 ++-- .../pure_uniform_disconnect_bug-357c849bf12e8832.yaml | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/pure_uniform_disconnect_bug-357c849bf12e8832.yaml diff --git a/cinder/tests/unit/volume/drivers/test_pure.py b/cinder/tests/unit/volume/drivers/test_pure.py index de59abc13e0..2117ca601c5 100644 --- a/cinder/tests/unit/volume/drivers/test_pure.py +++ b/cinder/tests/unit/volume/drivers/test_pure.py @@ -4252,7 +4252,7 @@ class PureFCDriverTestCase(PureBaseSharedDriverTestCase): self.driver.terminate_connection(vol, FC_CONNECTOR) mock_disconnect.assert_has_calls([ mock.call(mock_secondary, vol, FC_CONNECTOR, - is_multiattach=False, remove_remote_hosts=False), + is_multiattach=False, remove_remote_hosts=True), mock.call(self.array, vol, FC_CONNECTOR, is_multiattach=False, remove_remote_hosts=False) ]) diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index 3b0acfa9da6..f64fc8d126a 100644 --- a/cinder/volume/drivers/pure.py +++ b/cinder/volume/drivers/pure.py @@ -927,7 +927,7 @@ class PureBaseVolumeDriver(san.SanDriver): for array in self._uniform_active_cluster_target_arrays: try: self._disconnect(array, volume, connector, - remove_remote_hosts=False, + remove_remote_hosts=True, is_multiattach=multiattach) except purestorage.PureError as err: # Swallow any exception, just warn and continue @@ -3180,7 +3180,7 @@ class PureFCDriver(PureBaseVolumeDriver, driver.FibreChannelDriver): for array in self._uniform_active_cluster_target_arrays: try: no_more_connections = self._disconnect( - array, volume, connector, remove_remote_hosts=False, + array, volume, connector, remove_remote_hosts=True, is_multiattach=multiattach) if no_more_connections: unused_wwns += self._get_array_wwns(array) diff --git a/releasenotes/notes/pure_uniform_disconnect_bug-357c849bf12e8832.yaml b/releasenotes/notes/pure_uniform_disconnect_bug-357c849bf12e8832.yaml new file mode 100644 index 00000000000..e516e53fce4 --- /dev/null +++ b/releasenotes/notes/pure_uniform_disconnect_bug-357c849bf12e8832.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Pure Storage Cinder Driver: Fixed `bug 2029005 + `__ to correctly + disconnect a sync replicated volume from host on the secondary + array when uniform option is set to True.