diff options
| author | Adam Gandelman <adamg@canonical.com> | 2012-03-15 18:08:35 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-03-15 19:39:08 -0700 |
| commit | 6657f70ee3e792b39e45a2a96fb5d4b380f0ae91 (patch) | |
| tree | 3f60fd25b064491009c33fe0616b1a7b57f681bd | |
| parent | 67b84ddccc05b22a6e7e27a4c42893a6c50e5db9 (diff) | |
| download | nova-6657f70ee3e792b39e45a2a96fb5d4b380f0ae91.tar.gz nova-6657f70ee3e792b39e45a2a96fb5d4b380f0ae91.tar.xz nova-6657f70ee3e792b39e45a2a96fb5d4b380f0ae91.zip | |
Allow proper instance cleanup if state == SHUTOFF
Removes an obsolete check for instance's power_state
on shutdown_instance(). With it in place, volume detachment
and disassociation never takes place. Compute should instead rely
on virt drivers to handle this case and raise accordingly. libvirt's
destroy() currently handles powered off instances fine, and properly
detaches any existing volume connections.
Fixes bug 954692
Change-Id: I200d5b2073e5b52a9733d8324d016b14bdc96067
| -rw-r--r-- | nova/compute/manager.py | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index e91d5e9e3..e596f81af 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -673,13 +673,6 @@ class ComputeManager(manager.SchedulerDependentManager): # tear down allocated network structure self._deallocate_network(context, instance) - current_power_state = self._get_power_state(context, instance) - - if current_power_state == power_state.SHUTOFF: - self.db.instance_destroy(context, instance_id) - _msg = _('trying to destroy already destroyed instance: %s') - raise exception.Invalid(_msg % instance_uuid) - # NOTE(vish) get bdms before destroying the instance bdms = self._get_instance_volume_bdms(context, instance_id) block_device_info = self._get_instance_volume_block_device_info( |
