summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJian Wen <jian.wen@canonical.com>2013-01-14 19:13:24 +0800
committerJian Wen <jian.wen@canonical.com>2013-01-31 15:22:43 +0800
commitbe62d6a86971abac57a1cc03c985ba1e97fd55cb (patch)
tree4f0beece6fdf6bec93e18341322ed070d67ca203 /nova/api
parentb7e0c9dd588e5fad1cf4e3eb3f71828ca0122a55 (diff)
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
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/admin_actions.py2
1 files changed, 2 insertions, 0 deletions
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()