diff --git a/Add-VM-high-low-priority-feature-support.patch b/Add-VM-high-low-priority-feature-support.patch index 3910fbaeb611c9b47d6a18d55b056c0829aadfb9..3cb0db41e8267bae269aa2f180c6d4b17f2301b7 100644 --- a/Add-VM-high-low-priority-feature-support.patch +++ b/Add-VM-high-low-priority-feature-support.patch @@ -1,21 +1,21 @@ -From 26a8d5dc7c164f9f24cd86c0624da833a4d00afe Mon Sep 17 00:00:00 2001 +From 10a0978d2e3036fc08453270c980b51ce86dcee7 Mon Sep 17 00:00:00 2001 From: wangxiyuan -Date: Thu, 13 Oct 2022 11:08:33 +0800 -Subject: [PATCH] Add VM high/low priority feature support +Date: Thu, 19 Oct 2023 03:29:35 +0000 +Subject: [PATCH] [PATCH] Add VM high/low priority feature support --- - api/openstack/compute/schemas/servers.py | 4 ++ - compute/api.py | 25 +++++++-- - conf/compute.py | 10 +++- + api/openstack/compute/schemas/servers.py | 4 ++ + compute/api.py | 25 +++++++-- + conf/compute.py | 8 +++ .../versions/403_add_priority_mix_feature.py | 21 ++++++++ - db/sqlalchemy/models.py | 4 ++ - exception.py | 5 ++ - objects/fields.py | 12 +++++ - objects/instance.py | 7 ++- - virt/hardware.py | 54 ++++++++++++++++++- - virt/libvirt/config.py | 6 +++ - virt/libvirt/driver.py | 34 +++++++++--- - 11 files changed, 169 insertions(+), 13 deletions(-) + db/sqlalchemy/models.py | 4 ++ + exception.py | 5 ++ + objects/fields.py | 12 +++++ + objects/instance.py | 7 ++- + virt/hardware.py | 54 ++++++++++++++++++- + virt/libvirt/config.py | 6 +++ + virt/libvirt/driver.py | 34 +++++++++--- + 11 files changed, 168 insertions(+), 12 deletions(-) create mode 100644 db/sqlalchemy/migrate_repo/versions/403_add_priority_mix_feature.py diff --git a/api/openstack/compute/schemas/servers.py b/api/openstack/compute/schemas/servers.py @@ -106,15 +106,13 @@ index 4fa0cc2..d954e84 100644 # max_net_count is the maximum number of instances requested by the # user adjusted for any network quota constraints, including diff --git a/conf/compute.py b/conf/compute.py -index 6713f61..fec2542 100644 +index 6713f61..1ca74d1 100644 --- a/conf/compute.py +++ b/conf/compute.py -@@ -719,7 +719,15 @@ for performance reasons, for example, with Ironic. - Possible values: +@@ -723,6 +723,14 @@ Possible values: + ] - * Any positive integer representing greenthreads count. --""") -+"""), + compute_group_opts = [ + cfg.BoolOpt('cpu_priority_mix_enable', + default=False, + help=""" @@ -123,9 +121,9 @@ index 6713f61..fec2542 100644 +If enabled, The low priority VM can bind cpu both on dedicated and shared cpu +set. +"""), - ] - - compute_group_opts = [ + cfg.IntOpt('consecutive_build_service_disable_threshold', + default=10, + help=""" diff --git a/db/sqlalchemy/migrate_repo/versions/403_add_priority_mix_feature.py b/db/sqlalchemy/migrate_repo/versions/403_add_priority_mix_feature.py new file mode 100644 index 0000000..da37b6c @@ -344,10 +342,10 @@ index 39c4da8..e9db836 100644 os = etree.Element("os") type_node = self._text_node("type", self.os_type) diff --git a/virt/libvirt/driver.py b/virt/libvirt/driver.py -index 94d9982..dae25e3 100644 +index f51463f..1ea85a2 100644 --- a/virt/libvirt/driver.py +++ b/virt/libvirt/driver.py -@@ -4845,7 +4845,7 @@ class LibvirtDriver(driver.ComputeDriver): +@@ -4829,7 +4829,7 @@ class LibvirtDriver(driver.ComputeDriver): cell_pairs.append((guest_config_cell, host_cell)) return cell_pairs @@ -356,7 +354,7 @@ index 94d9982..dae25e3 100644 """Returns the config object of LibvirtConfigGuestCPUTuneVCPUPin. Prepares vcpupin config for the guest with the following caveats: -@@ -4860,12 +4860,14 @@ class LibvirtDriver(driver.ComputeDriver): +@@ -4844,12 +4844,14 @@ class LibvirtDriver(driver.ComputeDriver): pin_cpuset.cpuset = set([object_numa_cell.cpu_pinning[vcpu]]) else: pin_cpuset.cpuset = host_cell.cpuset @@ -372,7 +370,7 @@ index 94d9982..dae25e3 100644 """Returns a set of cpu_ids to add to the cpuset for emulator threads with the following caveats: -@@ -4885,6 +4887,7 @@ class LibvirtDriver(driver.ComputeDriver): +@@ -4869,6 +4871,7 @@ class LibvirtDriver(driver.ComputeDriver): """ emulatorpin_cpuset = set([]) shared_ids = hardware.get_cpu_shared_set() @@ -380,7 +378,7 @@ index 94d9982..dae25e3 100644 if emulator_threads_policy == fields.CPUEmulatorThreadsPolicy.ISOLATE: if object_numa_cell.cpuset_reserved: -@@ -4901,6 +4904,9 @@ class LibvirtDriver(driver.ComputeDriver): +@@ -4885,6 +4888,9 @@ class LibvirtDriver(driver.ComputeDriver): {'online': sorted(online_pcpus), 'req': sorted(shared_ids)}) raise exception.Invalid(msg) @@ -390,7 +388,7 @@ index 94d9982..dae25e3 100644 emulatorpin_cpuset = cpuset elif not wants_realtime or vcpu not in vcpus_rt: emulatorpin_cpuset = pin_cpuset.cpuset -@@ -4908,7 +4914,7 @@ class LibvirtDriver(driver.ComputeDriver): +@@ -4892,7 +4898,7 @@ class LibvirtDriver(driver.ComputeDriver): return emulatorpin_cpuset def _get_guest_numa_config(self, instance_numa_topology, flavor, @@ -399,7 +397,7 @@ index 94d9982..dae25e3 100644 """Returns the config objects for the guest NUMA specs. Determines the CPUs that the guest can be pinned to if the guest -@@ -4950,6 +4956,11 @@ class LibvirtDriver(driver.ComputeDriver): +@@ -4934,6 +4940,11 @@ class LibvirtDriver(driver.ComputeDriver): if CONF.vcpu_pin_set or CONF.compute.cpu_shared_set: shared_cpus = self._get_vcpu_available() @@ -411,7 +409,7 @@ index 94d9982..dae25e3 100644 topology = self._get_host_numa_topology() # We have instance NUMA so translate it to the config class -@@ -5011,12 +5022,13 @@ class LibvirtDriver(driver.ComputeDriver): +@@ -4995,12 +5006,13 @@ class LibvirtDriver(driver.ComputeDriver): object_numa_cell = instance_numa_topology.cells[guest_node_id] for cpu in guest_config_cell.cpus: pin_cpuset = self._get_pin_cpuset(cpu, object_numa_cell, @@ -427,7 +425,7 @@ index 94d9982..dae25e3 100644 guest_cpu_tune.emulatorpin.cpuset.update(emu_pin_cpuset) # TODO(berrange) When the guest has >1 NUMA node, it will -@@ -5782,7 +5794,7 @@ class LibvirtDriver(driver.ComputeDriver): +@@ -5766,7 +5778,7 @@ class LibvirtDriver(driver.ComputeDriver): guest.vcpus = flavor.vcpus guest_numa_config = self._get_guest_numa_config( @@ -436,7 +434,7 @@ index 94d9982..dae25e3 100644 guest.cpuset = guest_numa_config.cpuset guest.cputune = guest_numa_config.cputune -@@ -5887,8 +5899,18 @@ class LibvirtDriver(driver.ComputeDriver): +@@ -5871,8 +5883,18 @@ class LibvirtDriver(driver.ComputeDriver): if vpmems: self._guest_add_vpmems(guest, vpmems) @@ -456,4 +454,5 @@ index 94d9982..dae25e3 100644 ordered_vpmems = [] vpmems = self._get_vpmems(instance) -- -2.17.1 +2.33.0 + diff --git a/openstack-nova.spec b/openstack-nova.spec index 49b995a00fbf06cbd247a7a3e2f33fb0d76342a4..bdcceaf168f1a956ceba557ba03b61008e0c521c 100644 --- a/openstack-nova.spec +++ b/openstack-nova.spec @@ -29,7 +29,7 @@ Name: openstack-nova # Liberty semver reset # https://review.openstack.org/#/q/I6a35fa0dda798fad93b804d00a46af80f08d475c,n,z Version: 20.6.1 -Release: 10 +Release: 11 Summary: OpenStack Compute (nova) License: ASL 2.0 @@ -763,6 +763,9 @@ exit 0 %endif %changelog +* Thu Oct 19 2023 wangxiyuan -20.6.1-11 +- Fix priority-feature bug + * Thu Jun 01 2023 Han Guangyu - 20.6.1-10 - Suppress git output during openstack-nova-priority-feature installation/uninstallation