nova/nova/tests/unit/compute
Matt Riedemann 26da4418a9 Deal with cross-cell resize in _remove_deleted_instances_allocations
When reverting a cross-cell resize, conductor will:

1. clean up the destination host
2. set instance.hidden=True and destroy the instance in the
   target cell database
3. finish the revert on the source host which will revert the
   allocations on the source host held by the migration record
   so the instance will hold those again and drop the allocations
   against the dest host which were held by the instance.

If the ResourceTracker.update_available_resource periodic task runs
between steps 2 and 3 it could see that the instance is deleted
from the target cell but there are still allocations held by it and
delete them. Step 3 is what handles deleting those allocations for
the destination node, so we want to leave it that way and take the
ResourceTracker out of the flow.

This change simply checks the instance.hidden value on the deleted
instance and if hidden=True, assumes the allocations will be cleaned
up elsehwere (finish_revert_snapshot_based_resize_at_source).

Ultimately this is probably not something we *have* to have since
finish_revert_snapshot_based_resize_at_source is going to drop the
destination node allocations anyway, but it is good to keep clear
which actor is doing what in this process.

Part of blueprint cross-cell-resize

Change-Id: Idb82b056c39fd167864cadd205d624cb87cbe9cb
2019-12-12 12:00:33 -05:00
..
monitors Do not log a warning about not using compute monitors 2019-04-04 14:32:53 -04:00
__init__.py
eventlet_utils.py
fake_resource_tracker.py Tests: autospecs all the mock.patch usages 2019-08-19 09:43:10 -05:00
test_claims.py Rename Claims resources to compute_node 2019-09-23 13:45:03 -04:00
test_compute_api.py Confirm cross-cell resize from the API 2019-12-12 12:00:29 -05:00
test_compute_mgr.py Add revert_snapshot_based_resize_at_dest compute method 2019-12-12 12:00:33 -05:00
test_compute_utils.py Move compute_node_to_inventory_dict to test-only code 2019-11-07 17:34:33 -05:00
test_compute_xen.py Remove mox in nova/tests/unit/virt/xenapi/stubs.py 2018-06-21 23:59:39 +00:00
test_compute.py Do not mock setup net and migrate inst in NeutronFixture 2019-12-11 10:45:46 +01:00
test_flavors.py Make compute unit tests inherit from test.NoDBTestCase 2015-02-24 17:54:29 +02:00
test_host_api.py Merge "Remove service_uuids_online_data_migration" 2019-11-18 21:01:45 +00: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 Add resources dict into _Provider 2019-09-13 08:50:35 +00:00
test_resource_tracker.py Deal with cross-cell resize in _remove_deleted_instances_allocations 2019-12-12 12:00:33 -05:00
test_rpcapi.py Add revert_snapshot_based_resize_at_dest compute method 2019-12-12 12:00:33 -05:00
test_shelve.py Retrieve the allocations early 2019-09-13 08:50:35 +00:00
test_stats.py Use uuidsentinel from oslo.utils 2018-09-05 09:08:54 -05:00
test_virtapi.py Add a way to exit early from a wait_for_instance_event() 2019-12-02 07:00:26 -08:00