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, the volume from which instance is booted
remains 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.
Note:
Ankit had submitted same patch [1] earlier which was reverted [2] due
to a race condition on jenkins if an instance is deleted when it is in
building state. The patch was then rebumitted [3] fixing the
the failure of race condition by reverting the ObjectActionError
exception handling in _delete. This patch was later re-reverted [4]
due to continued jenkins race conditions.
The current patch avoids the jenkins race condition by leaving the flow
for instances in the BUILDING state unchanged and only calling
_local_delete() on instances in the shelved_offloaded or error states
when the instance has no host associated with it. This addresses the
concerns of the referenced bugs.
Reviewed: https:/ /review. openstack. org/256059 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=b7f83337658 181f0e7117c7f3b 07f69856ffe405
Committed: https:/
Submitter: Jenkins
Branch: master
commit b7f83337658181f 0e7117c7f3b07f6 9856ffe405
Author: ankitagrawal <email address hidden>
Date: Wed Sep 23 03:58:19 2015 -0700
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, the volume from which instance is booted
remains 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.
Note:
Ankit had submitted same patch [1] earlier which was reverted [2] due
to a race condition on jenkins if an instance is deleted when it is in
building state. The patch was then rebumitted [3] fixing the
the failure of race condition by reverting the ObjectActionError
exception handling in _delete. This patch was later re-reverted [4]
due to continued jenkins race conditions.
The current patch avoids the jenkins race condition by leaving the flow
for instances in the BUILDING state unchanged and only calling
_local_delete() on instances in the shelved_offloaded or error states
when the instance has no host associated with it. This addresses the
concerns of the referenced bugs.
[1] Ic630ae7d026a96 97afec46ac9ea40 aea0f5b5ffb ed1c1f22ccc972d 45b6d185f41 4ebb04eac58ef0c dbf506d6173 83c4d0e8233e8ad a26ebc512c2
[2] Id4e405e7579530
[3] Ic107d8edc7ee7a
[4] Ibcbe35b5d329b1
Co-Authored-By: Ankit Agrawal <email address hidden>
Closes-Bug: 1404867
Closes-Bug: 1408527
Change-Id: I928a397c75b857 e94bf5c002e50ec 43a2bed9848