Skip to content

Commit

Permalink
Destroy rescue instance if main instance is destroyed
Browse files Browse the repository at this point in the history
Fixes bug 955166

If the main instance was destroyed while an instance was in rescue mode
the rescue instance would not be destroyed. Ensure it gets destroyed
too.

Change-Id: I7d411a2b532fae7ba90c0639527805f47913fce6
  • Loading branch information
Johannes Erdfelt committed Mar 16, 2012
1 parent a3bab24 commit 1ecf2c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nova/virt/xenapi/vmops.py
Expand Up @@ -1182,6 +1182,12 @@ def destroy(self, instance, network_info):
"""
instance_uuid = instance['uuid']
LOG.info(_("Destroying VM for Instance %(instance_uuid)s") % locals())

rescue_vm_ref = VMHelper.lookup(self._session,
"%s-rescue" % instance.name)
if rescue_vm_ref:
self._destroy_rescue_instance(rescue_vm_ref)

vm_ref = VMHelper.lookup(self._session, instance.name)
return self._destroy(instance, vm_ref, network_info, shutdown=True)

Expand Down

0 comments on commit 1ecf2c5

Please sign in to comment.