nova/nova/tests/unit/compute
Artom Lifshitz a1d3ae3876 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().

Small conflict in nova/tests/unit/compute/test_compute_mgr.py due to
different mocks in the context.

[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)
(cherry picked from commit 7ace26e4bc)
(cherry picked from commit 703c8ef4e6)
2020-09-09 10:32:43 -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 post live migration: don't call Neutron needlessly 2020-09-09 10:32:43 -04:00
test_compute_api.py Merge "compute: Allow snapshots to be created from PAUSED volume backed instances" into stable/rocky 2020-08-26 04:14:49 +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 post live migration: don't call Neutron needlessly 2020-09-09 10:32:43 -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 Join migration_context and flavor in Migration.instance 2019-11-28 13:33:13 +00:00
test_rpcapi.py compute: Use long_rpc_timeout in reserve_block_device_name 2019-12-02 20:15:46 +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