From bcf002509db0d68b8e15a80b3267c2f6965a6ced Mon Sep 17 00:00:00 2001
From: Bartosz Bezak <bartosz@stackhpc.com>
Date: Mon, 10 Jul 2023 12:25:59 +0200
Subject: [PATCH] Enable nova libvirt driver skip_cpu_compare_on_dest
 workaround

With the libvirt driver, during live migration,skip comparing guest CPU
with the destination host. When using QEMU >= 2.9 and libvirt >= 4.4.0,
libvirt will do the correct thing with respect to checking CPU
compatibility on the destination host during live migration.[1]

[1] https://opendev.org/openstack/nova/commit/267a40663cd8d0b94bbc5ebda4ece55a45753b64

Change-Id: I947c94b59368c7a2740583bf57e407296473d75e
---
 .../nova-cell/templates/nova.conf.d/libvirt.conf.j2      | 2 ++
 .../notes/skip-cpu-compare-on-dest-927004854f41bc32.yaml | 9 +++++++++
 2 files changed, 11 insertions(+)
 create mode 100644 releasenotes/notes/skip-cpu-compare-on-dest-927004854f41bc32.yaml

diff --git a/ansible/roles/nova-cell/templates/nova.conf.d/libvirt.conf.j2 b/ansible/roles/nova-cell/templates/nova.conf.d/libvirt.conf.j2
index 69d8f9363..3f599c051 100644
--- a/ansible/roles/nova-cell/templates/nova.conf.d/libvirt.conf.j2
+++ b/ansible/roles/nova-cell/templates/nova.conf.d/libvirt.conf.j2
@@ -27,3 +27,5 @@ cpu_mode = {{ nova_libvirt_cpu_mode }}
 {% if enable_multipathd | bool %}
 volume_use_multipath = True
 {% endif %}
+[workarounds]
+skip_cpu_compare_on_dest = True
diff --git a/releasenotes/notes/skip-cpu-compare-on-dest-927004854f41bc32.yaml b/releasenotes/notes/skip-cpu-compare-on-dest-927004854f41bc32.yaml
new file mode 100644
index 000000000..10dd8980f
--- /dev/null
+++ b/releasenotes/notes/skip-cpu-compare-on-dest-927004854f41bc32.yaml
@@ -0,0 +1,9 @@
+---
+upgrade:
+  - |
+    Changes default value of nova libvirt driver setting
+    ``skip_cpu_compare_on_dest`` to true. With the libvirt driver, during
+    live migration, skip comparing guest CPU with the destination host.
+    When using QEMU >= 2.9 and libvirt >= 4.4.0, libvirt will do the correct
+    thing with respect to checking CPU compatibility on the destination host
+    during live migration.
-- 
GitLab