From 2aa501560384205b0fd3891ed5dd2a3864afcdc2 Mon Sep 17 00:00:00 2001 From: John Griffith Date: Thu, 13 Sep 2012 10:53:52 -0600 Subject: [PATCH] Add a resume delete on volume manager startup Currently if for some reason the volume service was stopped during the zero out operation of a volume delete there was no way to get the volume removed from the system (it would be present in deleting status forever). This change adds a simple check of volumes in the DB with status of deleting, and if any are found it restarts the delete process on them. addresses bug #1011150 Change-Id: Id4c4a3bc61f95245ebc6658234b4b88029956562 --- cinder/volume/manager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index beb038c2e..d1d1bfe23 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -102,6 +102,12 @@ class VolumeManager(manager.SchedulerDependentManager): else: LOG.info(_("volume %s: skipping export"), volume['name']) + LOG.debug(_('Resuming any in progress delete operations')) + for volume in volumes: + if volume['status'] == 'deleting': + LOG.info(_('Resuming delete on volume: %s' % volume['id'])) + self.delete_volume(ctxt, volume['id']) + def create_volume(self, context, volume_id, snapshot_id=None, image_id=None, reservations=None): """Creates and exports the volume.""" -- 2.45.2