From: Mathieu Gagné Date: Tue, 9 Jul 2013 17:59:43 +0000 (-0400) Subject: Handle errors raised by extend_volume X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=cfb849d4a9edc08395de4bb224aae1115eaa9a55;p=openstack-build%2Fcinder-build.git Handle errors raised by extend_volume Errors raised by extend_volume aren't handled by the manager. This means the volume status will not be updated to 'error_extending' when an error is raised during the process. * Handle such errors and update volume status accordingly * Add logging for the extend volume process Fixes: bug #1199471 Change-Id: I06a037af0344d1eaf4115f0af5a85ceeab1ffd37 --- diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index a446c3802..7c8500797 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -803,4 +803,13 @@ class VolumeManager(manager.SchedulerDependentManager): def extend_volume(self, context, volume_id, new_size): volume_ref = self.db.volume_get(context, volume_id) - self.driver.extend_volume(volume_ref, new_size) + + try: + LOG.info(_("volume %s: extending"), volume_ref['name']) + self.driver.extend_volume(volume_ref, new_size) + LOG.info(_("volume %s: extended successfully"), volume_ref['name']) + except Exception: + LOG.exception(_("volume %s: Error trying to extend volume"), + volume_id) + self.db.volume_update(context, volume_ref['id'], + {'status': 'error_extending'})