From b980df0d5423700719e3e6004de103a38886f070 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Sat, 11 Feb 2017 15:07:04 -0500 Subject: [PATCH] Bump minimum required libvirt/qemu versions for Pike Based on the libvirt distro support matrix wiki [1] this change bumps the minimum required version of libvirt to 1.2.9 and QEMU to 2.1.0. These were both advertised as the next minimums since Newton, we just never made the change in Ocata. The next minimum libvirt version is set to 1.3.1 and the next minimum QEMU version is set to 2.5.0, which is what we gate on with Ubuntu 16.04 but also falls within the distro support matrix for a representative set of other supported distros. [1] https://wiki.openstack.org/wiki/LibvirtDistroSupportMatrix Change-Id: I9a972e3fde2e4e552f6fc98350820c07873c3de3 --- nova/tests/functional/libvirt/test_numa_servers.py | 2 +- .../functional/libvirt/test_pci_sriov_servers.py | 2 +- nova/tests/functional/libvirt/test_rt_servers.py | 2 +- nova/tests/unit/virt/libvirt/fakelibvirt.py | 4 ++-- nova/tests/unit/virt/libvirt/test_driver.py | 14 ++++++++++---- nova/virt/libvirt/driver.py | 8 ++++---- .../pike-libvirt-min-version-bb7f43020995ac10.yaml | 8 ++++++++ 7 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 releasenotes/notes/pike-libvirt-min-version-bb7f43020995ac10.yaml diff --git a/nova/tests/functional/libvirt/test_numa_servers.py b/nova/tests/functional/libvirt/test_numa_servers.py index 54b41c6c60..f9ddcbd5fa 100644 --- a/nova/tests/functional/libvirt/test_numa_servers.py +++ b/nova/tests/functional/libvirt/test_numa_servers.py @@ -102,7 +102,7 @@ class NUMAServersTest(ServersTestBase): def _get_connection(self, host_info): fake_connection = fakelibvirt.Connection('qemu:///system', - version=1002007, + version=1002009, hv_version=2001000, host_info=host_info) return fake_connection diff --git a/nova/tests/functional/libvirt/test_pci_sriov_servers.py b/nova/tests/functional/libvirt/test_pci_sriov_servers.py index 4f62f7d82c..af7060dfad 100644 --- a/nova/tests/functional/libvirt/test_pci_sriov_servers.py +++ b/nova/tests/functional/libvirt/test_pci_sriov_servers.py @@ -85,7 +85,7 @@ class SRIOVServersTest(ServersTestBase): def _get_connection(self, host_info, pci_info): fake_connection = fakelibvirt.Connection('qemu:///system', - version=1002007, + version=1002009, hv_version=2001000, host_info=host_info, pci_info=pci_info) diff --git a/nova/tests/functional/libvirt/test_rt_servers.py b/nova/tests/functional/libvirt/test_rt_servers.py index 6337c3b860..127f4bd2a9 100644 --- a/nova/tests/functional/libvirt/test_rt_servers.py +++ b/nova/tests/functional/libvirt/test_rt_servers.py @@ -73,7 +73,7 @@ class RealTimeServersTest(ServersTestBase): cpu_cores=2, cpu_threads=2, kB_mem=15740000) fake_connection = fakelibvirt.Connection('qemu:///system', - version=1002007, + version=1002009, hv_version=2001000, host_info=host_info) with mock.patch('nova.virt.libvirt.host.Host.get_connection', diff --git a/nova/tests/unit/virt/libvirt/fakelibvirt.py b/nova/tests/unit/virt/libvirt/fakelibvirt.py index 1cca0f6184..fea9764a89 100644 --- a/nova/tests/unit/virt/libvirt/fakelibvirt.py +++ b/nova/tests/unit/virt/libvirt/fakelibvirt.py @@ -155,9 +155,9 @@ VIR_SECRET_USAGE_TYPE_CEPH = 2 VIR_SECRET_USAGE_TYPE_ISCSI = 3 # Libvirt version to match MIN_LIBVIRT_VERSION in driver.py -FAKE_LIBVIRT_VERSION = 1002001 +FAKE_LIBVIRT_VERSION = 1002009 # Libvirt version to match MIN_QEMU_VERSION in driver.py -FAKE_QEMU_VERSION = 1005003 +FAKE_QEMU_VERSION = 2001000 PF_CAP_TYPE = 'virt_functions' VF_CAP_TYPE = 'phys_function' diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index 874d6b553c..4433659b4c 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -2051,9 +2051,12 @@ class LibvirtConnTestCase(test.NoDBTestCase): return_value=caps), mock.patch.object( hardware, 'get_vcpu_pin_set', return_value=set([3])), - mock.patch.object(random, 'choice') + mock.patch.object(random, 'choice'), + mock.patch.object(drvr, '_has_numa_support', + return_value=False) ) as (get_host_cap_mock, - get_vcpu_pin_set_mock, choice_mock): + get_vcpu_pin_set_mock, choice_mock, + _has_numa_support_mock): cfg = drvr._get_guest_config(instance_ref, [], image_meta, disk_info) self.assertFalse(choice_mock.called) @@ -2225,9 +2228,12 @@ class LibvirtConnTestCase(test.NoDBTestCase): hardware, 'get_vcpu_pin_set', return_value=set([3])), mock.patch.object(random, 'choice'), mock.patch.object(pci_manager, "get_instance_pci_devs", - return_value=[pci_device, pci_device2]) + return_value=[pci_device, pci_device2]), + mock.patch.object(conn, '_has_numa_support', + return_value=False) ) as (get_host_cap_mock, - get_vcpu_pin_set_mock, choice_mock, pci_mock): + get_vcpu_pin_set_mock, choice_mock, pci_mock, + _has_numa_support_mock): cfg = conn._get_guest_config(instance_ref, [], image_meta, disk_info) self.assertFalse(choice_mock.called) diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index f2c0ecbc3e..8e994b70ae 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -197,15 +197,15 @@ patch_tpool_proxy() # versions. Over time, this will become a common min version # for all architectures/hypervisors, as this value rises to # meet them. -MIN_LIBVIRT_VERSION = (1, 2, 1) -MIN_QEMU_VERSION = (1, 5, 3) +MIN_LIBVIRT_VERSION = (1, 2, 9) +MIN_QEMU_VERSION = (2, 1, 0) # TODO(berrange): Re-evaluate this at start of each release cycle # to decide if we want to plan a future min version bump. # MIN_LIBVIRT_VERSION can be updated to match this after # NEXT_MIN_LIBVIRT_VERSION has been at a higher value for # one cycle -NEXT_MIN_LIBVIRT_VERSION = (1, 2, 9) -NEXT_MIN_QEMU_VERSION = (2, 1, 0) +NEXT_MIN_LIBVIRT_VERSION = (1, 3, 1) +NEXT_MIN_QEMU_VERSION = (2, 5, 0) # When the above version matches/exceeds this version # delete it & corresponding code using it diff --git a/releasenotes/notes/pike-libvirt-min-version-bb7f43020995ac10.yaml b/releasenotes/notes/pike-libvirt-min-version-bb7f43020995ac10.yaml new file mode 100644 index 0000000000..74abe705c1 --- /dev/null +++ b/releasenotes/notes/pike-libvirt-min-version-bb7f43020995ac10.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - | + The minimum required version of libvirt used by the `nova-compute` service + is now 1.2.9. The minimum required version of QEMU used by the + `nova-compute` service is now 2.1.0. Failing to meet these minimum versions + when using the libvirt compute driver will result in the `nova-compute` + service not starting.