So in the case of a volume that is placed in error state
on create and never actually deployed, the cinder.volume.api delete
call does a short cut call to db.destroy_volume which is fine because
all we have is a DB entry (scheduler never deployed the volume).
Unfortunately, this requires admin context, so just add an elevate
context to the db.destroy_volume call.
Fixes bug:
1084273
Change-Id: I0ef8bf4356047c385bef703b8dce7d5edf537bf6
except Exception:
reservations = None
LOG.exception(_("Failed to update quota for deleting volume"))
-
- self.db.volume_destroy(context, volume_id)
+ self.db.volume_destroy(context.elevated(), volume_id)
if reservations:
QUOTAS.commit(context, reservations)