nova/nova/virt
Kashyap Chamarthy 277f88e387 libvirt: Add a workaround to skip compareCPU() on destination
Nova's use of libvirt's compareCPU() API served its purpose
over the years, but its design limitations break live migration in
subtle ways.  For example, the compareCPU() API compares against the
host physical CPUID.  Some of the features from this CPUID aren not
exposed by KVM, and then there are some features that KVM emulates that
are not in the host CPUID.  The latter can cause bogus live migration
failures.

With QEMU >=2.9 and libvirt >= 4.4.0, libvirt will do the right thing in
terms of CPU compatibility checks on the destination host during live
migration.  Nova satisfies these minimum version requirements by a good
margin.  So, provide a workaround to skip the CPU comparison check on
the destination host before migrating a guest, and let libvirt handle it
correctly.  This workaround will be removed once Nova replaces the older
libvirt APIs with their newer and improved counterparts[1][2].

                - - -

Note that Nova's libvirt driver calls compareCPU() in another method,
_check_cpu_compatibility(); I did not remove its usage yet.  As it needs
more careful combing of the code, and then:

  - where possible, remove the usage of compareCPU() altogether, and
    rely on libvirt doing the right thing under the hood; or

  - where Nova _must_ do the CPU comparison checks, switch to the better
    libvirt CPU APIs -- baselineHypervisorCPU() and
    compareHypervisorCPU() -- that are described here[1].  This is work
    in progress[2].

[1] https://opendev.org/openstack/nova-specs/commit/70811da221035044e27
[2] https://review.opendev.org/q/topic:bp%252Fcpu-selection-with-hypervisor-consideration

Change-Id: I444991584118a969e9ea04d352821b07ec0ba88d
Closes-Bug: #1913716
Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
Signed-off-by: Balazs Gibizer <bgibizer@redhat.com>
(cherry picked from commit 267a40663c)
2022-06-08 16:44:08 +00:00
..
disk Add autopep8 to tox and pre-commit 2021-11-08 12:37:27 +00:00
hyperv Add supports_remote_managed_ports capability 2022-02-09 01:23:27 +03:00
image libvirt: virtuozzo instance resize support 2016-06-28 22:13:49 +03:00
ironic Add supports_remote_managed_ports capability 2022-02-09 01:23:27 +03:00
libvirt libvirt: Add a workaround to skip compareCPU() on destination 2022-06-08 16:44:08 +00:00
powervm Add supports_remote_managed_ports capability 2022-02-09 01:23:27 +03:00
vmwareapi Merge "VmWare: Remove unused legacy_nodename regex" 2022-02-23 14:00:09 +00:00
zvm Add supports_remote_managed_ports capability 2022-02-09 01:23:27 +03:00
__init__.py
arch.py Added ability to configure default architecture for ImagePropertiesFilter 2018-05-14 16:55:13 -04:00
block_device.py block_device: Ignore VolumeAttachmentNotFound during detach 2021-12-03 12:07:33 +00:00
configdrive.py Remove six.text_type (1/2) 2020-12-13 11:25:31 +00:00
driver.py Add supports_remote_managed_ports capability 2022-02-09 01:23:27 +03:00
event.py Port binding based on events during live migration 2018-07-19 09:09:55 -04:00
fake.py Add supports_remote_managed_ports capability 2022-02-09 01:23:27 +03:00
hardware.py Merge "Fix to implement 'pack' or 'spread' VM's NUMA cells" 2022-02-17 20:28:04 +00:00
imagecache.py Include removal of ephemeral backing files in the image cache manager 2020-10-09 12:24:06 +01:00
images.py images: Make JSON the default output format of calls to qemu-img info 2020-04-16 16:38:24 +01:00
interfaces.template
netutils.py nova-net: Remove final references to nova-network 2020-01-08 13:54:12 +00:00
osinfo.py Stop sending bad values from libosinfo to libvirt 2019-07-04 15:30:51 +01:00
storage_users.py Remove translation of log messages 2017-06-13 11:20:28 +07:00
virtapi.py Add a way to exit early from a wait_for_instance_event() 2019-12-02 07:00:26 -08:00