From 40692574bbdefbdfa4a6f3366bec524fd4612400 Mon Sep 17 00:00:00 2001 From: Matthew Sherborne Date: Sat, 20 Apr 2013 19:08:07 +1000 Subject: If rescue fails don't error the instance If a rescue attempt fails, the VM's state should return to what it was before the rescue attempt started, and the user should be notified of the failure. Fixes bug: 1170328 Change-Id: If5e97d06a3617adad83a4bba2ac6320616bbe83b --- nova/compute/manager.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 5da050f60..f1ab1629e 100755 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2007,7 +2007,6 @@ class ComputeManager(manager.SchedulerDependentManager): @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) @reverts_task_state @wrap_instance_event - @wrap_instance_fault def rescue_instance(self, context, instance, rescue_password=None): """ Rescue an instance on this host. @@ -2028,10 +2027,16 @@ class ComputeManager(manager.SchedulerDependentManager): else: rescue_image_meta = {} - with self._error_out_instance_on_exception(context, instance['uuid']): + try: self.driver.rescue(context, instance, self._legacy_nw_info(network_info), rescue_image_meta, admin_password) + except Exception as e: + LOG.exception(_("Error trying to Rescue Instance"), + instance=instance) + raise exception.InstanceNotRescuable( + instance_id=instance['uuid'], + reason=_("Driver Error: %s") % unicode(e)) current_power_state = self._get_power_state(context, instance) self._instance_update(context, -- cgit