Delete error volumes when deleting instance
Backport candidate. Change-Id: I799f7b30e1af396a8ae540cff2ba8b548a23f82c Story: 2007436 Task: 39083
This commit is contained in:
parent
c952838a9b
commit
513e0dd3cd
@ -789,7 +789,9 @@ class BaseInstance(SimpleInstance):
|
||||
try:
|
||||
if self.volume_id:
|
||||
volume = self.volume_client.volumes.get(self.volume_id)
|
||||
if volume.status == "available":
|
||||
if volume.status in ["available", "error"]:
|
||||
LOG.info("Deleting volume %s for instance %s",
|
||||
self.volume_id, self.id)
|
||||
volume.delete()
|
||||
except Exception as e:
|
||||
LOG.warning("Failed to delete volume for instance %s, error: %s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user