nova/nova/virt/libvirt
Lee Yarwood c438fd9a0e libvirt: Provide VIR_MIGRATE_PARAM_PERSIST_XML during live migration
The VIR_MIGRATE_PARAM_PERSIST_XML parameter was introduced in libvirt
v1.3.4 and is used to provide the new persistent configuration for the
destination during a live migration:

https://libvirt.org/html/libvirt-libvirt-domain.html#VIR_MIGRATE_PARAM_PERSIST_XML

Without this parameter the persistent configuration on the destination
will be the same as the original persistent configuration on the source
when the VIR_MIGRATE_PERSIST_DEST flag is provided.

As Nova does not currently provide the VIR_MIGRATE_PARAM_PERSIST_XML
param but does provide the VIR_MIGRATE_PERSIST_DEST flag this means that
a soft reboot by Nova of the instance after a live migration can revert
the domain back to the original persistent configuration from the
source.

Note that this is only possible in Nova as a soft reboot actually
results in the virDomainShutdown and virDomainLaunch libvirt APIs being
called that recreate the domain using the persistent configuration.
virDomainReboot does not result in this but is not called at this time.

The impact of this on the instance after the soft reboot is pretty
severe, host devices referenced in the original persistent configuration
on the source may not exist or could even be used by other users on the
destination. CPU and NUMA affinity could also differ drastically between
the two hosts resulting in the instance being unable to start etc.

As MIN_LIBVIRT_VERSION is now > v1.3.4 this change simply includes the
VIR_MIGRATE_PARAM_PERSIST_XML param using the same updated XML for the
destination as is already provided to VIR_MIGRATE_PARAM_DEST_XML.

NOTE(lyarwood): As this is no longer the case from stable/rocky the
change is slightly more involved introducing a persistent_xml_param
kwarg that is used from _live_migration_operation within the driver
based on the availability of libvirt v1.3.4 on the source host.

Co-authored-by: Tadayoshi Hosoya <tad-hosoya@wr.jp.nec.com>
Closes-Bug: #1890501
Change-Id: Ia3f1d8e83cbc574ce5cb440032e12bbcb1e10e98
(cherry picked from commit 1bb8ee95d4)
(cherry picked from commit bbf9d1de06)
(cherry picked from commit 6a07edb4b2)
(cherry picked from commit b9ea91d177)
2020-08-25 16:05:15 +01:00
..
storage Fix python3 compatibility of rbd get_fsid 2019-07-31 20:29:23 +00:00
volume Fixes multi-registry config in Quobyte driver 2019-06-03 07:42:32 +00:00
__init__.py Remove vi modelines 2014-02-03 14:19:44 +00:00
blockinfo.py Rename block_device_info_get_root 2018-01-11 20:46:13 +00:00
compat.py Remove translation of log messages 2017-06-13 11:20:28 +07:00
config.py Implement discard for file backed memory 2018-06-21 11:45:31 -05:00
designer.py add mtu to libvirt xml for ethernet and bridge types 2018-06-06 09:39:40 -04:00
driver.py libvirt: Provide VIR_MIGRATE_PARAM_PERSIST_XML during live migration 2020-08-25 16:05:15 +01:00
firewall.py Replaces uuid.uuid4 with uuidutils.generate_uuid() 2017-07-25 10:45:03 +05:30
guest.py libvirt: Provide VIR_MIGRATE_PARAM_PERSIST_XML during live migration 2020-08-25 16:05:15 +01:00
host.py libvirt: Don't react to VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED events 2018-08-23 14:44:22 -04:00
imagebackend.py Make RBD imagebackend flatten method idempotent 2020-02-19 11:25:18 +00:00
imagecache.py Move the dac_admin privsep code to a new location. 2017-09-18 23:14:11 +10:00
instancejobtracker.py Remove translation of log messages 2017-06-13 11:20:28 +07:00
migration.py libvirt: Avoid setting MTU during live migration if unset 2018-10-29 22:46:06 +01:00
utils.py Add method to get cpu traits 2018-07-24 12:37:46 +00:00
vif.py Ignore hw_vif_type for direct, direct-physical vNIC types 2019-07-02 14:11:28 +00:00