From 3aad12a6c3201cde711a01e673da0ec8995e08bf Mon Sep 17 00:00:00 2001 From: Simon Dodsley Date: Tue, 29 Jul 2025 21:54:32 -0400 Subject: [PATCH] [Pure Storage] Cinder manage quota breach deletion fix This patch fixes an issue where when a tenant attempts to manage a volume that exceeds their storage quota, the clenup will cause an error due to attemptinmg to delete a non-existant volume on the backend. Closes-Bug: #2119059 Change-Id: I57acda3d94af703b52bfc923a4928b089475b476 Signed-off-by: Simon Dodsley --- cinder/volume/drivers/pure.py | 10 ++++++---- .../pure_manage_quota_delete-dd24495e883498e7.yaml | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/pure_manage_quota_delete-dd24495e883498e7.yaml diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index aaa489d1042..cfb138e7955 100644 --- a/cinder/volume/drivers/pure.py +++ b/cinder/volume/drivers/pure.py @@ -971,8 +971,10 @@ class PureBaseVolumeDriver(san.SanDriver): current_array = self._get_current_array() # Do a pass over remaining connections on the current array, if # we can try and remove any remote connections too. - hosts = list(current_array.get_connections( - volume_names=[vol_name]).items) + hosts = [] + res = current_array.get_connections(volume_names=[vol_name]) + if res.status_code == 200: + hosts = list(res.items) for host_info in range(0, len(hosts)): host_name = hosts[host_info].host.name self._disconnect_host(current_array, host_name, vol_name) @@ -981,8 +983,6 @@ class PureBaseVolumeDriver(san.SanDriver): res = current_array.patch_volumes(names=[vol_name], volume=flasharray.VolumePatch( destroyed=True)) - if self.configuration.pure_eradicate_on_delete: - current_array.delete_volumes(names=[vol_name]) if res.status_code == 400: with excutils.save_and_reraise_exception() as ctxt: if ERR_MSG_NOT_EXIST in res.errors[0].message: @@ -990,6 +990,8 @@ class PureBaseVolumeDriver(san.SanDriver): ctxt.reraise = False LOG.warning("Volume deletion failed with message: %s", res.errors[0].message) + if self.configuration.pure_eradicate_on_delete: + current_array.delete_volumes(names=[vol_name]) # Now check to see if deleting this volume left an empty volume # group. If so, we delete / eradicate the volume group if "/" in vol_name: diff --git a/releasenotes/notes/pure_manage_quota_delete-dd24495e883498e7.yaml b/releasenotes/notes/pure_manage_quota_delete-dd24495e883498e7.yaml new file mode 100644 index 00000000000..ab61fade910 --- /dev/null +++ b/releasenotes/notes/pure_manage_quota_delete-dd24495e883498e7.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Pure Storage driver `Bug #21119059 `_: Fixed + volume deletion issue when attempting to manage a new volume that exceeds the tenants + storage quota.