When we shelve offload an instance, we unplug VIFs, delete
the guest from the compute host, etc. The instance is still
logically attached to its ports but they aren't connected
on any host.
When we unshelve an instance, it is scheduled and created
on a potentially new host, in a potentially new availability
zone. During unshelve, the compute manager will call the
setup_instance_network_on_host() method to update the port
host binding information for the new host, but was not
updating the device_owner, which reflects the availability
zone that the instance is in. Because of this, an instance
can be created in az1, shelved, and then unshelved in az2
but the port device_owner still says az1 even though the
port host binding is for a compute host in az2.
This change simply updates the port device_owner when
updating the port binding host during unshelve.
A TODO is left in the cleanup_instance_network_on_host()
method which is called during shelve offload but is currently
not implemented. We should unbind ports when shelve offloading,
but that is a bit of a bigger change and left for a separate
patch since it is not technically needed for this bug fix.
Change-Id: Ibd1cbe0e9b5cf3ede542dbf62b1a7d503ba7ea06
Closes-Bug: #1759924
(cherry picked from commit 93802619adde69bf84d26d7231480abb4da07c91)
(cherry picked from commit 3e38d1cf16ca29948be499aa37e2494ffd001f12)
(cherry picked from commit 245364ece1689853bf33ac25d7319618d064d909)
(cherry picked from commit c7bb9b1652b6df3e0a353a5c9f4cf70299c4e5e7)
Reviewed: https:/ /review. openstack. org/626413 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=0b3e45387ce 1979b394b38d6e1 24e001e2898c1a
Committed: https:/
Submitter: Zuul
Branch: stable/ocata
commit 0b3e45387ce1979 b394b38d6e124e0 01e2898c1a
Author: Matt Riedemann <email address hidden>
Date: Mon Apr 9 16:12:19 2018 -0400
Update port device_owner when unshelving
When we shelve offload an instance, we unplug VIFs, delete
the guest from the compute host, etc. The instance is still
logically attached to its ports but they aren't connected
on any host.
When we unshelve an instance, it is scheduled and created instance_ network_ on_host( ) method to update the port
on a potentially new host, in a potentially new availability
zone. During unshelve, the compute manager will call the
setup_
host binding information for the new host, but was not
updating the device_owner, which reflects the availability
zone that the instance is in. Because of this, an instance
can be created in az1, shelved, and then unshelved in az2
but the port device_owner still says az1 even though the
port host binding is for a compute host in az2.
This change simply updates the port device_owner when
updating the port binding host during unshelve.
A TODO is left in the cleanup_ instance_ network_ on_host( )
method which is called during shelve offload but is currently
not implemented. We should unbind ports when shelve offloading,
but that is a bit of a bigger change and left for a separate
patch since it is not technically needed for this bug fix.
Change-Id: Ibd1cbe0e9b5cf3 ede542dbf62b1a7 d503ba7ea06 f84d26d7231480a bb4da07c91) 48be499aa37e249 4ffd001f12) 3bf33ac25d73196 18d064d909) e0a353a5c9f4cf7 0299c4e5e7)
Closes-Bug: #1759924
(cherry picked from commit 93802619adde69b
(cherry picked from commit 3e38d1cf16ca299
(cherry picked from commit 245364ece168985
(cherry picked from commit c7bb9b1652b6df3