From be62d6a86971abac57a1cc03c985ba1e97fd55cb Mon Sep 17 00:00:00 2001 From: Jian Wen Date: Mon, 14 Jan 2013 19:13:24 +0800 Subject: Handle compute node not available for live migration This patch handles exception.ComputeServiceUnavailable by restoring instance's vm_state and instance's task_state after live migration failure caused by unavailable source/dest compute node. Raises detailed HTTPBadRequest explanation for this exception. Fixes bug 973393 and bug 1051881 Change-Id: If825b61fad9c4e3030f2e6c5002907255eaf3661 --- nova/api/openstack/compute/contrib/admin_actions.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/contrib/admin_actions.py b/nova/api/openstack/compute/contrib/admin_actions.py index 1c053ea59..dc3ee8fc4 100644 --- a/nova/api/openstack/compute/contrib/admin_actions.py +++ b/nova/api/openstack/compute/contrib/admin_actions.py @@ -282,6 +282,8 @@ class AdminActionsController(wsgi.Controller): instance = self.compute_api.get(context, id) self.compute_api.live_migrate(context, instance, block_migration, disk_over_commit, host) + except exception.ComputeServiceUnavailable as ex: + raise exc.HTTPBadRequest(explanation=str(ex)) except Exception: msg = _("Live migration of instance %(id)s to host %(host)s" " failed") % locals() -- cgit