nova/nova/tests/unit/compute
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
..
monitors Allow monitor plugins to set own metric object 2016-06-27 14:38:32 +05:30
__init__.py
eventlet_utils.py
fake_resource_tracker.py rt: explicitly pass compute node to _update() 2017-01-12 11:30:03 -08:00
test_claims.py rt: use a single ResourceTracker object instance 2017-01-16 14:09:25 -05:00
test_compute.py Detach volumes when VM creation fails 2018-04-18 19:31:13 -04:00
test_compute_api.py Raise MarkerNotFound if BuildRequestList.get_by_filters doesn't find marker 2018-01-03 12:48:04 -05:00
test_compute_cells.py Get original image_id from volume for volume-backed instance rebuild 2017-12-05 10:40:10 -05:00
test_compute_mgr.py Detach volumes when VM creation fails 2018-04-18 19:31:13 -04:00
test_compute_utils.py Fix missing instance.delete notification 2017-03-13 15:02:06 -04:00
test_compute_xen.py conf: Remove config option compute_ manager 2016-12-08 20:05:52 +08:00
test_flavors.py
test_host_api.py Remove compute host from all host aggregates when compute service is deleted 2016-07-16 22:19:44 +03:00
test_keypairs.py Move quota options to a config group. 2017-01-04 22:57:14 -06:00
test_resource_tracker.py Account for compute.metrics.update in legacy notification whitelist 2017-10-04 13:25:57 +00:00
test_rpcapi.py Change RPC post_live_migration_at_destination from cast to call. 2016-11-08 14:42:35 +00:00
test_shelve.py Call terminate_connection when shelve_offloading 2017-09-14 18:45:46 -04:00
test_stats.py
test_virtapi.py Remove mox from nova/tests/unit/compute/test_virtapi.py 2016-11-28 08:52:00 +00:00