ports/emulators/py-nova/files/05-online-cpus.patch
Roman Bogorodskiy b7e05e4ed3 Add emulators/py-nova 14.0.2, Openstack Compute Service
Please note that this is a development version of nova.
Many features are not available.

Currently nova works on FreeBSD 11 and supports QEMU and Xen.

Common issues:
- Security groups are not implemented
- ARP spoofing, DHCP isolation protection are not implemented
- Nova services work from the root user
- No IPv6 support

QEMU issues:
- Need to enable serialconsole (TCP)
- Need to disable online CPU tracking
- Cannot mount cinder volumes

Xen issues:
- Live snapshots don't work
- No support for cinder volume hot-plugging
- XENBUS delay (5 min) when using qemu driver and COW images
- Some Linux images cannot be booted

For further FreeBSD specific notes please refer to port's pkg-message.

PR:		215151
Submitted by:	Alexander Nusov (alexander.nusov@nfvexpress.com)
2016-12-18 06:30:58 +00:00

63 lines
2.2 KiB
Diff

From 8eb8fb92f21243ae0e41f2f626398d09582de29b Mon Sep 17 00:00:00 2001
From: Alexander Nusov <alexander.nusov@nfvexpress.com>
Date: Fri, 25 Nov 2016 17:36:10 +0300
Subject: [PATCH] add online cpu tracking option
---
nova/conf/libvirt.py | 3 +++
nova/virt/libvirt/driver.py | 18 +++++++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/nova/conf/libvirt.py b/nova/conf/libvirt.py
index 2eba080..d133b03 100644
--- a/nova/conf/libvirt.py
+++ b/nova/conf/libvirt.py
@@ -471,6 +471,9 @@ events`, refer https://libvirt.org/formatdomain.html#elementsPerf .
None
"""),
+ cfg.BoolOpt('online_cpu_tracking',
+ default=True,
+ help='Enable online cpu tracking'),
]
libvirt_imagebackend_opts = [
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index f9225de..f19ef70 100644
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -5188,11 +5188,12 @@ class LibvirtDriver(driver.ComputeDriver):
cells = []
allowed_cpus = hardware.get_vcpu_pin_set()
- online_cpus = self._host.get_online_cpus()
- if allowed_cpus:
- allowed_cpus &= online_cpus
- else:
- allowed_cpus = online_cpus
+ if CONF.libvirt.online_cpu_tracking:
+ online_cpus = self._host.get_online_cpus()
+ if allowed_cpus:
+ allowed_cpus &= online_cpus
+ else:
+ allowed_cpus = online_cpus
def _get_reserved_memory_for_cell(self, cell_id, page_size):
cell = self._reserved_hugepages.get(cell_id, {})
@@ -5205,8 +5206,11 @@ class LibvirtDriver(driver.ComputeDriver):
if cpu.siblings else ()
for cpu in cell.cpus)
))
- cpuset &= allowed_cpus
- siblings = [sib & allowed_cpus for sib in siblings]
+ if CONF.libvirt.online_cpu_tracking or allowed_cpus:
+ cpuset &= allowed_cpus
+ siblings = [sib & allowed_cpus for sib in siblings]
+
+
# Filter out singles and empty sibling sets that may be left
siblings = [sib for sib in siblings if len(sib) > 1]
--
2.8.1