nova/nova/tests/unit/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 Fixes multi-registry config in Quobyte driver 2019-10-07 14:00:02 +00:00
__init__.py
fake_imagebackend.py libvirt: update logic to configure device for scsi controller 2017-07-03 03:23:53 -04:00
fake_libvirt_utils.py Change livesnapshot to true by default 2017-09-22 12:37:58 -04:00
fake_os_brick_connector.py Switch to using os-brick 2015-07-27 10:47:22 -07:00
fakelibvirt.py libvirt: move checking CONF.my_ip to init_host() 2019-07-22 16:30:12 -04:00
test_blockinfo.py Modify the test case of get_disk_mapping_rescue_with_config 2018-01-12 14:08:51 +08:00
test_compat.py Workaround for race condition in libvirt 2015-03-14 20:17:41 -03:00
test_config.py add mtu to libvirt xml for ethernet and bridge types 2018-07-04 17:33:26 +01:00
test_designer.py add mtu to libvirt xml for ethernet and bridge types 2018-07-04 17:33:26 +01:00
test_driver.py libvirt: Provide VIR_MIGRATE_PARAM_PERSIST_XML during live migration 2020-09-18 17:01:37 +02:00
test_fakelibvirt.py libvirt: Fix getting a wrong guest object 2017-08-23 19:55:12 +09:00
test_firewall.py Replaces uuid.uuid4 with uuidutils.generate_uuid() 2017-07-25 10:45:03 +05:30
test_guest.py Add missing libvirt exception during device detach 2019-04-16 13:43:28 +00:00
test_host.py Encode libvirt domain XML in UTF-8 2018-02-08 15:45:59 -05:00
test_imagebackend.py Make RBD imagebackend flatten method idempotent 2020-02-19 11:25:37 +00:00
test_imagecache.py Move the dac_admin privsep code to a new location. 2017-09-18 23:14:11 +10:00
test_migration.py libvirt: QEMU native LUKS decryption for encrypted volumes 2018-01-23 10:47:05 +00:00
test_utils.py qemu-img do not use cache=none if no O_DIRECT support 2017-11-29 22:33:39 +00:00
test_vif.py Fix non-existent method of Mock 2019-08-16 10:27:22 +09:00