summaryrefslogtreecommitdiffstats
path: root/nova/exception.py
diff options
context:
space:
mode:
authorDevananda van der Veen <devananda.vdv@gmail.com>2013-02-08 20:36:19 -0800
committerVishvananda Ishaya <vishvananda@gmail.com>2013-02-20 11:51:21 -0800
commit48439b98a1a7ac2dded34c8899918773f70667f2 (patch)
tree7bd41c90a657c70fec68a2dc29e1655beb059d66 /nova/exception.py
parentc20110d15be37948ddd9ef5f38001328aabf5b1d (diff)
downloadnova-48439b98a1a7ac2dded34c8899918773f70667f2.tar.gz
nova-48439b98a1a7ac2dded34c8899918773f70667f2.tar.xz
nova-48439b98a1a7ac2dded34c8899918773f70667f2.zip
Wait for baremetal deploy inside driver.spawn
Previously, baremetal driver.spawn returned as soon as the machine power turned on, but before the user-image was deployed to the hardware node, and long before the node was available on the network. This meant the nova instance was marked as ACTIVE before provisioning had actually finished. If the deploy failed and the baremetal node was set to an ERROR state, the nova instance could still be left as ACTIVE and the user was never informed of the error. This patch introduces a LoopingCall to monitor the deployment status in the baremetal database. As the deployment is performed by nova-baremetal-deploy-helper, the database record is updated. Once the deployment is complete, driver.spawn() sets the baremetal node status and the nova instance status is also set properly. If an error occurs during the deployment, an exception is raised within driver.spawn() allowing nova to follow the normal cleanup and notify paths. This also allows the baremetal PXE driver to delete cached image files when a baremetal deployment fails. Fixes bug 1088655. Change-Id: I4feefd462fd956c9780995ec8b05b13e78278c8b
Diffstat (limited to 'nova/exception.py')
-rw-r--r--nova/exception.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/exception.py b/nova/exception.py
index fd0122835..ada55ba32 100644
--- a/nova/exception.py
+++ b/nova/exception.py
@@ -335,6 +335,10 @@ class InstanceTerminationFailure(Invalid):
message = _("Failed to terminate instance") + ": %(reason)s"
+class InstanceDeployFailure(Invalid):
+ message = _("Failed to deploy instance") + ": %(reason)s"
+
+
class ServiceUnavailable(Invalid):
message = _("Service is unavailable at this time.")