From c1336173394040d168963cae26475036c107fe19 Mon Sep 17 00:00:00 2001 From: Thales Elero Cervi Date: Mon, 13 Nov 2023 09:25:40 -0300 Subject: [PATCH] Skip destination CPU check during live-migration OpenStack 2023.1 (Antelope) introduced this issue [1][2] when live-migrating instances, in which Nova uses getCapabilities() to determine the host CPU model but use the model from the domCapabilities for the guest VM using host-model [3]. According to the libvirt maintainers nova should never use getCapabilities for anything any more. A solution for this issue is being developed in main branch [4], but taken as a medium priority since there is a workaround config option already available [5] to avoid this situation. Setting "skip_cpu_compare_on_dest" to True will, 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. StarlingX currently delivers QEMU 5.2 and stx-openstack uses a libvirt on 7.0.0-3, therefore this can be safely used as part of our default nova configuration updates. [1] https://bugs.launchpad.net/nova/+bug/2023035 [2] https://bugs.launchpad.net/nova/+bug/2039803 [3] https://review.opendev.org/q/topic:fix_compareCPU_usage [4] https://review.opendev.org/c/openstack/nova/+/899185 [5] https://docs.openstack.org/nova/latest/configuration/config.html#skip_cpu_compare_on_dest Closes-bug: 2007303 TEST PLAN: PASS - Build python3-k8sapp-openstack plugins PASS - Build stx-openstack application PASS - Upload/Apply/Remove stx-openstack PASS - Live-migrate an instance PASS - Manually reboot a compute node in which an instance is running to ensure it is correctly evacuated to another compute Change-Id: Id7a93445af4115ee81b035b4f9dc7a6eb889555b Signed-off-by: Thales Elero Cervi --- .../k8sapp_openstack/k8sapp_openstack/helm/nova.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python3-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nova.py b/python3-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nova.py index 9438daf3..3d3c847a 100644 --- a/python3-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nova.py +++ b/python3-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nova.py @@ -784,10 +784,19 @@ class NovaHelm(openstack.OpenstackBaseHelm): 'ephemeral_storage': self._get_rbd_ephemeral_storage(), 'admin_keyring': admin_keyring, }, + # NOTE(tcervi): Nova config options reference: + # https://docs.openstack.org/nova/latest/configuration/sample-config.html + # https://docs.openstack.org/nova/latest/configuration/config.html 'nova': { 'libvirt': { 'virt_type': self._get_virt_type(), }, + # NOTE(tcervi): Workaround needed since OpenStack 2023.1 + # Can be removed once nova/+bug/2023035 and + # nova/+bug/2039803 are fixed. + 'workarounds': { + 'skip_cpu_compare_on_dest': True, + }, 'vnc': { 'novncproxy_base_url': self._get_novncproxy_base_url(), },