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 b2734b5a9ae8b869fc9e8e229826343da3b47fcb.
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.
Reviewed: https:/ /review. opendev. org/750670 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=7ace26e4bcd 69a0a3d780cfae9 f6745e4177b6c2
Committed: https:/
Submitter: Zuul
Branch: stable/train
commit 7ace26e4bcd69a0 a3d780cfae9f674 5e4177b6c2
Author: Artom Lifshitz <email address hidden>
Date: Fri Aug 21 13:06:58 2020 -0400
post live migration: don't call Neutron needlessly
In bug 1879787, the call to network_ api.get_ instance_ nw_info( ) in live_migration( ) on the source compute manager eventually calls live_migration_ at_destination( ).
_post_
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_
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 api.migrate_ instance_ start() [1] call that nw_info( ) call. nw_info( ) will always return the source get_network_ info().
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_
happens shortly *after* the problematic get_instance_
In other words, get_instance_
ports. Because of that, we can replace it with a call to
instance.
NOTE(artom) The functional test has been excised, as in stable/train move-ops- with-qos- ports-ussuri, and starts at 9fc9e8e22982634 3da3b47fcb.
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-
commit b2734b5a9ae8b86
NOTE(artom) The post_live_ migration_ no_shared_ storage_ working_ correctly and post_live_ migration_ cinder_ v3_api unit tests had to be adjusted
test_
test_
as part of the backport to pass with the new code.
[1] https:/ /opendev. org/openstack/ nova/src/ commit/ d9e04c4ff0b1a9c 3383f1848dc846e 93030d83cb/ nova/network/ neutronv2/ api.py# L2493-L2522
Change-Id: If0fbae33ce2af1 98188c91638afef 939256c2556 a448596e2084f48 4dd0bfa916) 282060da12d3277 1582953aa2)
Closes-bug: 1879787
(cherry picked from commit 6488a5dfb293831
(cherry picked from commit 2c949cb3eea9cd9