nova/nova/tests/unit/virt
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
..
disk lxc: make use of filter python3 compatible 2019-09-17 18:48:21 +00:00
hyperv Fix 'has_calls' method calls in unit tests 2019-08-20 12:00:52 +09:00
image
ironic Lowercase ironic driver hash ring and ignore case in cache 2020-04-24 22:50:32 +00:00
libvirt libvirt: Provide VIR_MIGRATE_PARAM_PERSIST_XML during live migration 2020-08-25 16:05:15 +01:00
powervm Share snapshot image membership with instance owner 2019-04-30 21:13:46 +09:00
vmwareapi Fix wrong assertions in unit tests 2019-08-20 14:00:47 +09:00
xenapi xenapi/agent: Change openssl error handling 2019-04-30 08:40:53 -04:00
zvm Share snapshot image membership with instance owner 2019-04-30 21:13:46 +09:00
__init__.py
fakelibosinfo.py Stop sending bad values from libosinfo to libvirt 2019-10-11 09:32:54 +01:00
test_block_device.py Override the 'get' method in DriverBlockDevice class 2019-03-26 12:13:56 +09:00
test_configdrive.py
test_driver.py Remove usage of parameter enforce_type 2017-04-17 20:23:19 +08:00
test_events.py
test_fake.py
test_firewall.py remove get_nw_info_for_instance from compute.utils 2017-06-13 13:30:06 +02:00
test_hardware.py hardware: fix memory check usage for small/large pages 2018-09-03 14:45:26 +00:00
test_imagecache.py Remove mox from tests/unit/virt/test_imagecache.py 2016-06-16 23:40:01 +00:00
test_images.py Fix execute mock for test_convert_image_with_errors 2018-06-14 12:33:21 +00:00
test_netutils.py Remove unnecessary code 2017-07-28 06:01:21 +00:00
test_osinfo.py Stop sending bad values from libosinfo to libvirt 2019-10-11 09:32:54 +01:00
test_virt.py Rename block_device_info_get_root 2018-01-11 20:46:13 +00:00
test_virt_drivers.py libvirt: Provide VIR_MIGRATE_PARAM_PERSIST_XML during live migration 2020-08-25 16:05:15 +01:00