nova/nova/virt/libvirt
Lee Yarwood a721ca5f51 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.

Conflicts:
    nova/tests/unit/virt/libvirt/test_driver.py
    nova/tests/unit/virt/test_virt_drivers.py
    nova/virt/libvirt/driver.py
    nova/virt/libvirt/guest.py

NOTE(lyarwood): Conflicts as If0a091a7441f2c3269148e40ececc3696d69684c
(libvirt: Bump MIN_{LIBVIRT,QEMU}_VERSION for "Rocky"),
Id9ee1feeadf612fa79c3d280cee3a614a74a00a7 (libvirt: Remove usage of
migrateToURI{2} APIs) and I3af68f745ffb23ef2b5407ccec0bebf4b2645734
(Remove mox in test_virt_drivers.py) are not present on stable/queens.
As a result we can now add the parameter directly in
_live_migration_operation before calling down into guest.migrate.

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)
(cherry picked from commit c438fd9a0e)
2020-09-18 17:01:37 +02:00
..
storage Move shred to privsep. 2017-10-23 09:36:28 +11:00
volume Removed the host FQDN from the exception message 2020-09-03 00:31:28 +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 add mtu to libvirt xml for ethernet and bridge types 2018-07-04 17:33:26 +01:00
designer.py add mtu to libvirt xml for ethernet and bridge types 2018-07-04 17:33:26 +01:00
driver.py libvirt: Provide VIR_MIGRATE_PARAM_PERSIST_XML during live migration 2020-09-18 17:01:37 +02:00
firewall.py Replaces uuid.uuid4 with uuidutils.generate_uuid() 2017-07-25 10:45:03 +05:30
guest.py Add missing libvirt exception during device detach 2019-04-16 13:43:28 +00:00
host.py Removed the host FQDN from the exception message 2020-09-03 00:31:28 +00:00
imagebackend.py Make RBD imagebackend flatten method idempotent 2020-02-19 11:25:37 +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: QEMU native LUKS decryption for encrypted volumes 2018-01-23 10:47:05 +00:00
utils.py Move the idmapshift binary into privsep. 2017-10-24 18:50:23 +11:00
vif.py libvirt: add qemu version check when configuring mtu for network 2018-07-05 11:20:11 +01:00