nova/nova/tests/unit/compute
Matt Riedemann b8435d6001 Delete allocations even if _confirm_resize raises
When we are confirming a resize, the guest is on the dest
host and the instance host/node values in the database
are pointing at the dest host, so the _confirm_resize method
on the source is really best effort. If something fails, we
should not leak allocations in placement for the source compute
node resource provider since the instance is not actually
consuming the source node provider resources.

This change refactors the error handling around the _confirm_resize
call so the big nesting for _error_out_instance_on_exception is
moved to confirm_resize and then a try/finally is added around
_confirm_resize so we can be sure to try and cleanup the allocations
even if _confirm_resize fails in some obscure way. If _confirm_resize
does fail, the error gets re-raised along with logging a traceback
and hint about how to correct the instance state in the DB by hard
rebooting the server on the dest host.

Change-Id: I29c5f491ec20a71283190a1599e7732541de736f
Closes-Bug: #1821594
(cherry picked from commit 03a6d26691)
(cherry picked from commit 5f515060f6)
(cherry picked from commit 37ac54a42e)
2019-05-29 00:50:29 +00: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 Teardown networking when rolling back live migration even if shared disk 2019-05-09 16:14:06 +00:00
test_compute_api.py Create request spec, build request and mappings in one transaction 2019-04-30 14:22:03 +00:00
test_compute_cells.py Fix host validity check for live-migration 2018-08-09 16:31:58 +05:30
test_compute_mgr.py Delete allocations even if _confirm_resize raises 2019-05-29 00:50:29 +00:00
test_compute_utils.py Bump compute RPC API to version 5.0 2018-02-08 10:43:56 -08:00
test_compute_xen.py Make xen unit tests work with os-xenapi>=0.3.0 2017-09-05 16:06:31 -04:00
test_flavors.py Make compute unit tests inherit from test.NoDBTestCase 2015-02-24 17:54:29 +02:00
test_host_api.py Make nova service-list use scatter-gather routine 2018-06-29 12:22:37 +00:00
test_instance_list.py Make nova list and migration-list ignore down cells 2018-06-26 18:44:47 +02:00
test_keypairs.py Transform keypair.import notification 2017-10-30 16:44:29 -04:00
test_multi_cell_list.py Some nit fix in multi_cell_list 2017-12-13 14:27:20 +08:00
test_provider_tree.py ProviderTree.get_provider_uuids: Top-down ordering 2018-01-31 08:35:35 -06:00
test_resource_tracker.py Update resources once in update_available_resource 2019-03-25 05:36:10 +00:00
test_rpcapi.py Compute RPC client bump to 5.0 2018-02-08 12:10:04 -08:00
test_shelve.py Fix shelving a paused instance 2018-05-20 22:11:04 +00:00
test_stats.py Change consecutive build failure limit to a weigher 2018-06-07 07:17:51 -07:00
test_virtapi.py Fix cancel_all_events event name parsing 2018-08-21 11:04:00 -07:00