nova/nova/virt
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
..
disk lxc: make use of filter python3 compatible 2019-10-02 13:41:45 +00:00
hyperv hyper-v: Logs tips on PortBindingFailed 2018-03-07 17:00:02 +00:00
image libvirt: virtuozzo instance resize support 2016-06-28 22:13:49 +03:00
ironic ironic: add instance_uuid before any other spawn activity 2020-07-28 10:40:05 +01:00
libvirt libvirt: Provide VIR_MIGRATE_PARAM_PERSIST_XML during live migration 2020-09-18 17:01:37 +02:00
powervm Stringify instance UUID 2018-05-10 09:56:32 -05:00
vmwareapi VMware: fix TypeError while get console log 2018-08-13 11:54:42 +00:00
xenapi xenapi/agent: Change openssl error handling 2019-04-30 09:07:53 -04:00
__init__.py Declare nova.virt namespace 2016-04-28 15:01:44 +00:00
arch.py Added ability to configure default architecture for ImagePropertiesFilter 2018-05-15 12:28:43 +00:00
block_device.py block_device: Rollback volumes to in-use on DeviceDetachFailed 2018-08-10 16:38:18 +01:00
configdrive.py Cleanup mount / umount and associated rmdir calls 2017-10-18 17:52:58 +11:00
driver.py ironic: add instance_uuid before any other spawn activity 2020-07-28 10:40:05 +01:00
event.py
fake.py Add functional recreate test for regression bug 1825537 2019-08-08 18:47:42 -04:00
firewall.py Merge "Remove translation of log messages" 2017-06-20 21:16:49 +00:00
hardware.py [Stable Only] hardware: Handle races during pinning 2019-03-27 12:29:05 +00:00
imagecache.py Rename ImageCacheManager._list_base_images to _scan_base_images 2016-05-26 14:45:42 +01:00
images.py libvirt: handle DiskNotFound during update_available_resource 2018-05-31 10:48:58 +01:00
interfaces.template
netutils.py provide interface-scoped nameserver information 2017-07-19 21:08:59 -04:00
osinfo.py Stop sending bad values from libosinfo to libvirt 2019-10-11 09:34:10 +01:00
storage_users.py Remove translation of log messages 2017-06-13 11:20:28 +07:00
virtapi.py Remove unused provider firewall rules functionality in nova 2016-02-01 15:50:04 +01:00