nova/nova/compute
Matt Riedemann 5600309a1f [stable-only] Delete allocations even if _confirm_resize raises (part 2)
The backport https://review.opendev.org/#/c/652153/ to fix
bug 1821594 did not account for how the _delete_allocation_after_move
method before Stein is tightly coupled to the migration status
being set to "confirmed" which is what the _confirm_resize method
does after self.driver.confirm_migration returns.

However, if self.driver.confirm_migration raises an exception
we still want to cleanup the allocations held on the source node
and for that we call _delete_allocation_after_move. But because
of that tight coupling before Stein, we need to temporarily
mutate the migration status to "confirmed" to get the cleanup
method to do what we want.

This isn't a problem starting in Stein because change
I0851e2d54a1fdc82fe3291fb7e286e790f121e92 removed that
tight coupling on the migration status, so this is a stable
branch only change.

Note that we don't call self.reportclient.delete_allocation_for_instance
directly since before Stein we still need to account for a
migration that does not move the source node allocations to the
migration record, and that logic is in _delete_allocation_after_move.

A simple unit test assertion is added here but the functional
test added in change I9d6478f492351b58aa87b8f56e907ee633d6d1c6
will assert the bug is fixed properly before Stein.

Change-Id: I933687891abef4878de09481937d576ce5899511
Closes-Bug: #1821594
(cherry picked from commit dac3239e92)
2019-05-29 00:52:49 +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 [stable-only] Delete allocations even if _confirm_resize raises (part 2) 2019-05-29 00:52:49 +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