[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 <simon@purestorage.com>
This commit is contained in:
@@ -971,8 +971,10 @@ class PureBaseVolumeDriver(san.SanDriver):
|
|||||||
current_array = self._get_current_array()
|
current_array = self._get_current_array()
|
||||||
# Do a pass over remaining connections on the current array, if
|
# Do a pass over remaining connections on the current array, if
|
||||||
# we can try and remove any remote connections too.
|
# we can try and remove any remote connections too.
|
||||||
hosts = list(current_array.get_connections(
|
hosts = []
|
||||||
volume_names=[vol_name]).items)
|
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)):
|
for host_info in range(0, len(hosts)):
|
||||||
host_name = hosts[host_info].host.name
|
host_name = hosts[host_info].host.name
|
||||||
self._disconnect_host(current_array, host_name, vol_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],
|
res = current_array.patch_volumes(names=[vol_name],
|
||||||
volume=flasharray.VolumePatch(
|
volume=flasharray.VolumePatch(
|
||||||
destroyed=True))
|
destroyed=True))
|
||||||
if self.configuration.pure_eradicate_on_delete:
|
|
||||||
current_array.delete_volumes(names=[vol_name])
|
|
||||||
if res.status_code == 400:
|
if res.status_code == 400:
|
||||||
with excutils.save_and_reraise_exception() as ctxt:
|
with excutils.save_and_reraise_exception() as ctxt:
|
||||||
if ERR_MSG_NOT_EXIST in res.errors[0].message:
|
if ERR_MSG_NOT_EXIST in res.errors[0].message:
|
||||||
@@ -990,6 +990,8 @@ class PureBaseVolumeDriver(san.SanDriver):
|
|||||||
ctxt.reraise = False
|
ctxt.reraise = False
|
||||||
LOG.warning("Volume deletion failed with message: %s",
|
LOG.warning("Volume deletion failed with message: %s",
|
||||||
res.errors[0].message)
|
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
|
# Now check to see if deleting this volume left an empty volume
|
||||||
# group. If so, we delete / eradicate the volume group
|
# group. If so, we delete / eradicate the volume group
|
||||||
if "/" in vol_name:
|
if "/" in vol_name:
|
||||||
|
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Pure Storage driver `Bug #21119059 <https://bugs.launchpad.net/cinder/+bug/2119059>`_: Fixed
|
||||||
|
volume deletion issue when attempting to manage a new volume that exceeds the tenants
|
||||||
|
storage quota.
|
Reference in New Issue
Block a user