nova/nova/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 Remove translation of log messages 2017-06-09 09:06:16 +00:00
__init__.py Switch to using oslo_* instead of oslo.* 2015-02-06 06:03:10 -05:00
api.py Create request spec, build request and mappings in one transaction 2019-04-30 14:22:03 +00:00
build_results.py Compute Add build_instance hook in compute manager 2014-12-04 10:12:00 -05:00
cells_api.py Fix missing marker functions 2018-01-25 03:37:48 +00:00
claims.py [Trivial] docstrings, typos, minor refactoring 2017-08-28 08:33:58 -05:00
flavors.py Add microversion to allow setting flavor description 2017-11-15 22:10:39 +00:00
instance_actions.py Add instance action record for snapshot instances 2017-12-11 17:46:38 +08:00
instance_list.py Split instance_list into instance and multi_cell 2017-12-04 10:59:55 +08:00
manager.py Delete allocations even if _confirm_resize raises 2019-05-29 00:50:29 +00:00
migration_list.py Fix comment in MigrationSortContext 2018-01-10 14:04:23 -05:00
multi_cell_list.py Make nova list and migration-list ignore down cells 2018-06-26 18:44:47 +02:00
power_state.py Removed enum duplication from nova.compute 2016-09-02 07:30:44 +00:00
provider_tree.py ProviderTree.get_provider_uuids: Top-down ordering 2018-01-31 08:35:35 -06:00
resource_tracker.py Update resources once in update_available_resource 2019-03-25 05:36:10 +00:00
rpcapi.py Fix up compute rpcapi version for pike release 2018-10-23 15:03:11 +11:00
stats.py Change consecutive build failure limit to a weigher 2018-06-07 07:17:51 -07:00
task_states.py Fix resource tracker updates during instance evacuation 2019-03-14 10:30:08 +08:00
utils.py Call generate_image_url only for legacy notification 2018-07-23 18:30:33 +02:00
vm_states.py Removed enum duplication from nova.compute 2016-09-02 07:30:44 +00:00