Detach volume after deleting instance with no host
If an instance is booted from a volume, shelved, and goes into an error
state due to some reason. Volume from which instance is booted, remains
in-use state even the instance is deleted because instance has no host
associated with it.
Called _local_delete() to detach volume and destroy bdm if instance is
in shelved_offloaded state or has no host associated with it. This will
cleanup both volumes and the networks.
Currently in test_servers.py, "test_delete_server_instance" executes
similar to "test_delete_server_instance_while_building". This is because
"test_delete_server_instance" calls instance.save() method which updates
vm_state to building where it should be in active state.
Fixed "test_delete_server_instance" to test deleting an instance which
is in active state and has a valid host.
Reviewed: https:/ /review. openstack. org/145738 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=d1baa9fe7eb 342b63fc85cbb5e f70bb676de6566
Committed: https:/
Submitter: Jenkins
Branch: master
commit d1baa9fe7eb342b 63fc85cbb5ef70b b676de6566
Author: ankitagrawal <email address hidden>
Date: Tue Dec 23 06:34:32 2014 -0800
Detach volume after deleting instance with no host
If an instance is booted from a volume, shelved, and goes into an error
state due to some reason. Volume from which instance is booted, remains
in-use state even the instance is deleted because instance has no host
associated with it.
Called _local_delete() to detach volume and destroy bdm if instance is
in shelved_offloaded state or has no host associated with it. This will
cleanup both volumes and the networks.
Currently in test_servers.py, "test_delete_ server_ instance" executes server_ instance_ while_building" . This is because delete_ server_ instance" calls instance.save() method which updates
similar to "test_delete_
"test_
vm_state to building where it should be in active state.
Fixed "test_delete_ server_ instance" to test deleting an instance which
is in active state and has a valid host.
Closes-Bug: #1404867 97afec46ac9ea40 aea0f5b5ffb
Closes-Bug: #1408527
Change-Id: Ic630ae7d026a96