nova/nova/tests/unit/compute
Matt Riedemann 03a6d26691 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
2019-03-29 09:38:42 -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 Use a static resource tracker in compute manager 2019-01-17 06:34:29 +00:00
test_claims.py Make Claim._claim_test handle SchedulerLimits object 2019-02-12 11:59:51 -05:00
test_compute.py Merge "De-cruftify the finish_resize methods" 2019-03-28 19:15:51 +00:00
test_compute_api.py Update instance.availability_zone on revertResize 2019-03-13 21:12:04 -04:00
test_compute_cells.py Flavor extra spec and image properties validation from API 2019-03-05 12:05:06 -06:00
test_compute_mgr.py Delete allocations even if _confirm_resize raises 2019-03-29 09:38:42 -04:00
test_compute_utils.py Commonize _update code path 2019-01-16 18:34:39 +00:00
test_compute_xen.py Remove mox in nova/tests/unit/virt/xenapi/stubs.py 2018-06-21 23:59:39 +00:00
test_flavors.py Make compute unit tests inherit from test.NoDBTestCase 2015-02-24 17:54:29 +02:00
test_host_api.py Minimal construct plumbing for nova service-list when a cell is down 2018-10-31 15:22:15 -04:00
test_instance_list.py Plumbing for ignoring list_records_by_skipping_down_cells 2019-02-08 16:28:28 -05:00
test_keypairs.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_multi_cell_list.py Refactor scatter-gather utility to return exception objects 2018-10-31 15:18:07 -04:00
test_provider_tree.py Reduce calls to placement from _ensure 2019-01-16 18:34:34 +00:00
test_resource_tracker.py Merge "Convert driver supported capabilities to compute node provider traits" 2019-03-05 09:50:12 +00:00
test_rpcapi.py Pass request_spec from compute to cell conductor on reschedule 2018-12-19 17:32:33 -05:00
test_shelve.py Extract compute API _create_image to compute.utils 2019-02-05 12:27:57 -05:00
test_stats.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_virtapi.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00