nova/nova/tests/unit/compute
Artom Lifshitz 7ace26e4bc post live migration: don't call Neutron needlessly
In bug 1879787, the call to network_api.get_instance_nw_info() in
_post_live_migration() on the source compute manager eventually calls
out to the Neutron REST API. If this fails, the exception is
unhandled, and the migrating instance - which is fully running on the
destination at this point - will never be updated in the database.
This update normally happens later in
post_live_migration_at_destination().

The network_info variable obtained from get_instance_nw_info() is used
for two things: notifications - which aren't critical - and unplugging
the instance's vifs on the source - which is very important!

It turns out that at the time of the get_instance_nw_info() call, the
network info in the instance info cache is still valid for unplugging
the source vifs. The port bindings on the destination are only
activated by the network_api.migrate_instance_start() [1] call that
happens shortly *after* the problematic get_instance_nw_info() call.
In other words, get_instance_nw_info() will always return the source
ports. Because of that, we can replace it with a call to
instance.get_network_info().

NOTE(artom) The functional test has been excised, as in stable/train
the NeutronFixture does not properly support live migration with
ports, making the test worthless. The work to support this was done as
part of bp/support-move-ops-with-qos-ports-ussuri, and starts at
commit b2734b5a9a.

NOTE(artom) The
test_post_live_migration_no_shared_storage_working_correctly and
test_post_live_migration_cinder_v3_api unit tests had to be adjusted
as part of the backport to pass with the new code.

[1] d9e04c4ff0/nova/network/neutronv2/api.py (L2493-L2522)

Change-Id: If0fbae33ce2af198188c91638afef939256c2556
Closes-bug: 1879787
(cherry picked from commit 6488a5dfb2)
(cherry picked from commit 2c949cb3ee)
2020-09-09 10:15:04 -04: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 objects: Add 'NUMACell.pcpuset' field 2019-09-18 00:21:10 +01:00
test_compute.py post live migration: don't call Neutron needlessly 2020-09-09 10:15:04 -04:00
test_compute_api.py Add checks for volume status when rebuilding 2020-08-29 12:53:29 +02:00
test_compute_mgr.py post live migration: don't call Neutron needlessly 2020-09-09 10:15:04 -04:00
test_compute_utils.py Add nova.compute.utils.delete_image 2019-08-27 14:26:33 -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
test_host_api.py Follow up for pre-filter-disabled-computes series 2019-07-03 15:53:06 -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 Add resources dict into _Provider 2019-09-13 08:50:35 +00:00
test_resource_tracker.py Join migration_context and flavor in Migration.instance 2019-11-14 22:06:53 +00:00
test_rpcapi.py compute: Use long_rpc_timeout in reserve_block_device_name 2019-12-02 20:09:55 +00: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 VirtAPI.update_compute_provider_status 2019-07-02 11:45:40 -04:00