nova/nova/tests
Ameed Ashour b188492ca4 Detach volumes when VM creation fails
If the boot-volume creation fails, the data volume is left in state
"in-use", attached to the server which is now in "error" state.
The user can't detach the volume because of the server's error state.

They can delete the server, which then leaves the volume apparently
attached to a server that no longer exists, which is being fixed
separately: https://review.openstack.org/#/c/340614/

The only way out of this is to ask an administrator to reset the state of
the data volume (this option is not available to regular users by
default policy).

This change fixes the problem in the compute service such that
when the creation fails, compute manager detaches the created volumes
before putting the VM into error state. Then you can delete the instance
without care about attached volumes.

Conflicts:
      nova/compute/manager.py

NOTE(mriedem): The conflict in _delete_instance is due to restructuring
the method in I9269ffa2b80e48db96c622d0dc0817738854f602 in Pike. Also
note that _LW has to be used for the warning message since those
translation markers are still required in Ocata.

Change-Id: I8b1c05317734e14ea73dc868941351bb31210bf0
Closes-bug: #1633249
(cherry picked from commit 61f6751a18)
(cherry picked from commit 22164d5118)
(cherry picked from commit 4dbe72f976)
2018-04-18 19:31:13 -04:00
..
functional Merge "Functional test for regression bug #1713783" into stable/ocata 2018-04-17 16:17:01 +00:00
live_migration/hooks Fix libvirt group selection in live migration test 2017-04-21 13:28:18 +00:00
unit Detach volumes when VM creation fails 2018-04-18 19:31:13 -04:00
__init__.py
fixtures.py Add regression test for rebuilding a volume-backed server 2017-12-05 10:39:57 -05:00
uuidsentinel.py Remove redundant str typecasting 2016-09-23 12:53:34 +05:30