diff options
| author | Matt Odden <mrodden@us.ibm.com> | 2012-11-09 00:06:58 +0000 |
|---|---|---|
| committer | Matt Odden <mrodden@us.ibm.com> | 2012-11-09 00:27:48 +0000 |
| commit | 321780625993aa685c629995ecccc8bbb64ae4e7 (patch) | |
| tree | 8c36d65446e8db9700f76150766f03f0816cb94f /nova/virt | |
| parent | ab9ee3d232e0000dd8b8f1d2623d8ac72a6c9247 (diff) | |
powervm: failed spawn should raise exception
fixes bug #1065295
On a failed spawn instance, we should run our cleanup on
the host and then re-raise the exception to inform
ComputeManager of a failure
Change-Id: Ia9ce8360117e94d10d53278d4c9a16931dea70f2
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/powervm/operator.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/nova/virt/powervm/operator.py b/nova/virt/powervm/operator.py index 09ad662b3..6ed7535a7 100644 --- a/nova/virt/powervm/operator.py +++ b/nova/virt/powervm/operator.py @@ -26,7 +26,9 @@ from nova import flags from nova import utils from nova.compute import power_state +from nova.openstack.common import excutils from nova.openstack.common import log as logging + from nova.virt import images from nova.virt.powervm import command from nova.virt.powervm import common @@ -264,7 +266,13 @@ class PowerVMOperator(object): time.sleep(1) except exception.PowerVMImageCreationFailed: - self._cleanup(instance['name']) + with excutils.save_and_reraise_exception(): + # log errors in cleanup + try: + self._cleanup(instance['name']) + except Exception: + LOG.exception(_('Error while attempting to ' + 'clean up failed instance launch.')) def destroy(self, instance_name): """Destroy (shutdown and delete) the specified instance. |
