nova/nova/tests/unit/compute
Matt Riedemann cbf6a46d8f Drop source node allocations if finish_resize fails
By the time finish_resize runs on the dest host, the instance
host/node values are already pointing at the dest (they are
set by resize_instance on the source compute before casting to
finish_resize on the dest). If finish_resize fails, the instance
is essentially stuck on the dest host so rather than revert the
allocations (which will drop the new flavor allocations against
the dest host where the instance now lives) we should just drop
the old flavor allocations on the source node resource provider,
which is what this change does.

The functional regression recreate test is updated to show this
working.

Conflicts:
      nova/tests/functional/regressions/test_bug_1825537.py
      nova/tests/functional/test_servers.py

NOTE(mriedem): The functional test conflicts are due to not having
change If6aa37d9b6b48791e070799ab026c816fda4441c in Rocky.
The code fix is also different because we don't have change
I0851e2d54a1fdc82fe3291fb7e286e790f121e92 in Rocky and cannot use
the _delete_allocation_after_move method as documented inline.
This also means we have to deal with migration-based and legacy
tracked allocations (where the source and dest node allocations
are both on the instance consumer). As such, similar logic to
_delete_allocation_after_move is used to try and delete the
migration-based allocations first and failing that, attempt
to cleanup the source node allocations the legacy way by removing
them from the "doubled up" allocations created by the scheduler.
Since this is new logic in the backport, a functional test is
added to cover the legacy cleanup flow.

Change-Id: I52c8d038118c858004e17e71b2fba9e9e2714815
Closes-Bug: #1825537
(cherry picked from commit ea297d6ffb)
(cherry picked from commit e6c6178d22)
2019-07-05 12:30:02 -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 rt: explicitly pass compute node to _update() 2017-01-12 11:30:03 -08:00
test_claims.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_compute.py Merge "Allow driver to properly unplug VIFs on destination on confirm resize" into stable/rocky 2019-06-13 19:38:16 +00:00
test_compute_api.py Merge "Share snapshot image membership with instance owner" into stable/rocky 2019-06-28 19:17:19 +00:00
test_compute_cells.py Fix host validity check for live-migration 2018-08-08 15:02:13 +00:00
test_compute_mgr.py Drop source node allocations if finish_resize fails 2019-07-05 12:30:02 -04:00
test_compute_utils.py Heal RequestSpec.is_bfv for legacy instances during moves 2018-07-23 12:24:10 -04: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 Enforce case-sensitive hostnames in aggregate host add 2018-09-25 19:08:25 -04:00
test_instance_list.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_keypairs.py Use nova.db.api directly 2018-07-10 14:56:27 +00: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 Add method to get cpu traits 2018-07-24 12:37:46 +00:00
test_resource_tracker.py Fix resource tracker updates during instance evacuation 2019-03-05 19:22:14 +08:00
test_rpcapi.py Make compute rpcapi version calculation check all cells 2018-12-13 16:10:05 +00:00
test_shelve.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
test_stats.py Change consecutive build failure limit to a weigher 2018-06-06 15:18:50 -07:00
test_virtapi.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00