From 86fedcb59235f5fa90ab946cae905d3a42fe1053 Mon Sep 17 00:00:00 2001 From: Simon Dodsley Date: Thu, 19 Dec 2024 11:09:55 -0500 Subject: [PATCH] [Pure Storage] Remove SafeMode PGs from Replication Pods When using synchronous replication, FlashArrays use pods to facilitate this. If a backend array has SafeMode enabled, pods will be created with a SafeMode protection group. As SafeMode is not supported by Cinder we need to check if a SafeMode protection group was created for a Cinder replication pod, and if so remove this. Change-Id: I2c3c82babf54b5f5f003a98a52ec3d1c5efcea5d --- cinder/volume/drivers/pure.py | 25 +++++++++++++++++++ .../pure_pod_safemode-d64b0705828529e5.yaml | 6 +++++ 2 files changed, 31 insertions(+) create mode 100644 releasenotes/notes/pure_pod_safemode-d64b0705828529e5.yaml diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index 53a621f2a82..7293682c42b 100644 --- a/cinder/volume/drivers/pure.py +++ b/cinder/volume/drivers/pure.py @@ -2799,6 +2799,31 @@ class PureBaseVolumeDriver(san.SanDriver): " eradicated - will recreate.", name) source_array.delete_pods(names=[name]) self._create_pod_if_not_exist(source_array, name) + else: + if self._array.safemode: + # Now we check to ensure that the created pod does not have a + # safemode protection group attached to it as this is not + # supported by Cinder + safemode_pg = list( + source_array.get_container_default_protections( + names=[name]).items)[0].default_protections + if safemode_pg: + pgname = safemode_pg[0].name + res = source_array.patch_container_default_protections( + names=[name], + container_default_protection=( + flasharray.ContainerDefaultProtection( + default_protections=[]))) + if res.status_code != 200: + LOG.warning("Failed to remove Default Protection " + "Container: %s", res.errors[0]) + else: + source_array.patch_protection_groups( + names=[pgname], + protection_group=flasharray.ProtectionGroup( + destroyed=True)) + source_array.delete_protection_groups( + names=[pgname]) @pure_driver_debug_trace def _create_protection_group_if_not_exist(self, source_array, pgname): diff --git a/releasenotes/notes/pure_pod_safemode-d64b0705828529e5.yaml b/releasenotes/notes/pure_pod_safemode-d64b0705828529e5.yaml new file mode 100644 index 00000000000..62b33decb7f --- /dev/null +++ b/releasenotes/notes/pure_pod_safemode-d64b0705828529e5.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + [Pure Storage] When using synchronous replication, ensure that + FlashArray pods used by Cinder do not have SafeMode protection + groups attached, as SafeMode is not supported by Cinder.