From 72e75dbcea66e6e4e2b0f5a931dcd647b2032ad6 Mon Sep 17 00:00:00 2001 From: John Garbutt Date: Thu, 14 Mar 2013 15:41:47 +0000 Subject: xenapi: ensure vdi is not too big when resizing down Fix for bug 1155066 This change adds some rollback into the resize disk down code within xenapi, and reports a better error message when the disk is too big to resize down. On a successful rollback, the user is notified of the error by the instance actions, rather than leaving the server in the error state. The user is then able to free up some disk space such that the resize can work correctly. Change-Id: Ibad568ab3cfb9caaf4fe002572c8cda973d501a7 --- nova/compute/manager.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 79903f854..7bc8281d4 100755 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -4117,6 +4117,13 @@ class ComputeManager(manager.SchedulerDependentManager): reservations=None): try: yield + except exception.InstanceFaultRollback, error: + self._quota_rollback(context, reservations) + msg = _("Setting instance back to ACTIVE after: %s") + LOG.info(msg % error, instance_uuid=instance_uuid) + self._instance_update(context, instance_uuid, + vm_state=vm_states.ACTIVE) + raise error.inner_exception except Exception, error: with excutils.save_and_reraise_exception(): self._quota_rollback(context, reservations) -- cgit