nova/nova/objects
Matthew Booth 75e0f5a9b1 Avoid redundant initialize_connection on source post live migration
During live migration we update bdm.connection_info for attached volumes
in pre_live_migration to reflect the new connection on the destination
node. This means that after migration completes the BDM no longer has a
reference to the original connection_info to do the detach on the source
host. To address this, change I3dfb75eb added a second call to
initialize_connection on the source host to re-fetch the source host
connection_info before calling disconnect.

Unfortunately the cinder driver interface does not strictly require that
multiple calls to initialize_connection will return consistent results.
Although they normally do in practice, there is at least one cinder
driver (delliscsi) which doesn't. This results in a failure to
disconnect on the source host post migration.

This change avoids the issue entirely by fetching the BDMs prior to
modification on the destination node. As well as working round this
specific issue, it also avoids a redundant cinder call in all cases.

Note that this massively simplifies post_live_migration in the libvirt
driver. The complexity removed was concerned with reconstructing the
original connection_info. This required considering the cinder v2 and v3
use cases, and reconstructing the multipath_id which was written to
connection_info by the libvirt fibrechannel volume connector on
connection. These things are not necessary when we just use the original
data unmodified.

Other drivers affected are Xenapi and HyperV. Xenapi doesn't touch
volumes in post_live_migration, so is unaffected. HyperV did not
previously account for differences in connection_info between source and
destination, so was likely previously broken. This change should fix it.

NOTE(lyarwood): conflict due to Ibb8c12fb2799bb5ceb9e3d72a2b86dbb4f14451e
not being present in stable/rocky.

Conflicts:
        nova/tests/unit/compute/test_compute_mgr.py

Closes-Bug: #1754716
Closes-Bug: #1814245
Change-Id: I0390c9ff51f49b063f736ca6ef868a4fa782ede5
(cherry picked from commit b626c0dc7b)
2019-02-14 10:10:36 +00:00
..
__init__.py network: Always retrieve network information if available 2018-07-03 16:50:06 +01:00
agent.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
aggregate.py Transform aggregate.update_prop notification 2018-07-15 23:36:31 +09:00
bandwidth_usage.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
base.py [placement] Object changes to support last-modified headers 2017-12-07 18:47:17 +00:00
block_device.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
build_request.py Fix incompatible version handling in BuildRequest 2019-01-18 09:55:11 +01:00
cell_mapping.py Fix using template cell urls with nova-manage 2019-01-24 18:08:20 -05:00
compute_node.py Ignore uuid if already set in ComputeNode.update_from_virt_driver 2018-10-17 16:24:10 +02:00
console_auth_token.py Use nova-consoleauth only if workaround enabled 2018-10-15 17:38:39 +00:00
diagnostics.py Added nova objects for intance diagnostics 2017-05-30 00:39:44 +04:00
dns_domain.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
ec2.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
external_event.py Add ability to signal and perform online volume size change 2017-07-12 11:53:20 -04:00
fields.py Assorted cleanups from numa-aware-vswitches series 2018-07-27 09:49:12 -07:00
fixed_ip.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
flavor.py Merge "Remove old flavor_create db api method" 2018-03-20 18:11:06 +00:00
floating_ip.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
host_mapping.py Add --by-service to discover_hosts 2018-03-16 15:55:19 -07:00
hv_spec.py objects: Move 'hv_type' to 'fields.HVType' 2016-11-25 16:19:43 +00:00
image_meta.py Update ImageMetaProp object to expose traits 2018-04-05 16:18:59 -07:00
instance.py Default embedded instance.flavor.is_public attribute 2018-11-21 15:10:57 -05:00
instance_action.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
instance_fault.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
instance_group.py Merge "Delete instance_group_member records from API DB during archive" into stable/rocky 2018-09-21 12:01:46 +00:00
instance_info_cache.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
instance_mapping.py Fix InstanceMapping to always default queued_for_delete=False 2019-02-07 16:16:17 +01:00
instance_numa_topology.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
instance_pci_requests.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
keypair.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
migrate_data.py Avoid redundant initialize_connection on source post live migration 2019-02-14 10:10:36 +00:00
migration.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
migration_context.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
monitor_metric.py Fix MonitorMetric obj_make_compatible 2016-09-12 14:10:41 +00:00
network.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
network_metadata.py Assorted cleanups from numa-aware-vswitches series 2018-07-27 09:49:12 -07:00
network_request.py Merge "Remove DictCompat from NetworkRequest" 2016-06-30 10:23:36 +00:00
numa.py objects: Add NUMATopologyLimits.network_metadata 2018-07-09 10:08:08 +01:00
pci_device.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
pci_device_pool.py [2/3]Replace six.iteritems() with .items() 2017-01-09 09:11:00 +00:00
quotas.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
request_spec.py Don't persist RequestSpec.requested_destination 2018-10-19 15:42:08 -04:00
security_group.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
security_group_rule.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
selection.py Move the to_dict() method to the Selection object 2017-12-07 15:01:09 +00:00
service.py Annotate flows and handle PortBindingDeletionFailed in ComputeManager 2018-07-19 09:09:55 -04:00
tag.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
task_log.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
trusted_certs.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
vcpu_model.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
virt_cpu_topology.py cleanup NovaObjectDictCompat from virt_cpu_topology 2015-08-05 08:56:30 +05:30
virt_device_metadata.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
virtual_interface.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00
volume_usage.py Use nova.db.api directly 2018-07-10 14:56:27 +00:00