Fix cpu_shared/dedicated_set config location
Change I61514389b616db754b0d2f35deb0101f90dbdd02 removed the deprecated
property vcpu_pin_set in favor of the newer cpu_shared_set and
cpu_dedicated_set, but those new configs are placed under the [compute]
section of nova.conf instead of [DEFAULT]. This is causing VMs to be
scheduled on platform reserved cores. This commit will fix it.
Closes-Bug: #1928683
Signed-off-by: Thiago Brito <thiago.brito@windriver.com>
(cherry picked from commit 963e63cd55
)
Change-Id: I6bb7dee74e18b2889d683757adb8bb91987f45db
changes/85/792185/1
5.0.1
parent
8600f24732
commit
61fc911694
|
@ -266,27 +266,25 @@ class NovaHelm(openstack.OpenstackBaseHelm):
|
|||
else:
|
||||
return 'kvm'
|
||||
|
||||
def _update_host_cpu_maps(self, host, default_config):
|
||||
def _update_host_cpu_maps(self, host, compute_config):
|
||||
host_cpus = self._get_host_cpu_list(host, threads=True)
|
||||
if host_cpus:
|
||||
# "Applicaton" CPUs on the platform are used for regular Openstack
|
||||
# VMs
|
||||
vm_cpus = self._get_host_cpu_list(
|
||||
host, function=constants.APPLICATION_FUNCTION, threads=True)
|
||||
vm_cpu_list = [c.cpu for c in vm_cpus]
|
||||
vm_cpu_fmt = "\"%s\"" % utils.format_range_set(vm_cpu_list)
|
||||
default_config.update({'cpu_shared_set': vm_cpu_fmt})
|
||||
compute_config.update({'cpu_shared_set': vm_cpu_fmt})
|
||||
|
||||
# "Application-isolated" CPUs are completely isolated from the host
|
||||
# process scheduler and are used on Openstack VMs that require
|
||||
# dedicated CPUs
|
||||
isol_cpus = self._get_host_cpu_list(
|
||||
host, function=constants.ISOLATED_FUNCTION, threads=True)
|
||||
isol_cpu_list = [c.cpu for c in isol_cpus]
|
||||
isol_cpu_fmt = "\"%s\"" % utils.format_range_set(isol_cpu_list)
|
||||
default_config.update({'cpu_dedicated_set': vm_cpu_fmt})
|
||||
|
||||
shared_cpus = self._get_host_cpu_list(
|
||||
host, function=constants.SHARED_FUNCTION, threads=True)
|
||||
shared_cpu_map = {c.numa_node: c.cpu for c in shared_cpus}
|
||||
shared_cpu_fmt = "\"%s\"" % ','.join(
|
||||
"%r:%r" % (node, cpu) for node, cpu in shared_cpu_map.items())
|
||||
default_config.update({'shared_pcpu_map': shared_cpu_fmt})
|
||||
compute_config.update({'cpu_dedicated_set': isol_cpu_fmt})
|
||||
|
||||
def _get_pci_pt_whitelist(self, host, iface_context):
|
||||
# Process all configured PCI passthrough interfaces and add them to
|
||||
|
@ -720,10 +718,11 @@ class NovaHelm(openstack.OpenstackBaseHelm):
|
|||
|
||||
hostname = str(host.hostname)
|
||||
default_config = {}
|
||||
compute_config = {}
|
||||
vnc_config = {}
|
||||
libvirt_config = {}
|
||||
pci_config = {}
|
||||
self._update_host_cpu_maps(host, default_config)
|
||||
self._update_host_cpu_maps(host, compute_config)
|
||||
self._update_host_storage(host, default_config, libvirt_config)
|
||||
self._update_host_addresses(host, default_config, vnc_config,
|
||||
libvirt_config)
|
||||
|
@ -734,9 +733,10 @@ class NovaHelm(openstack.OpenstackBaseHelm):
|
|||
'conf': {
|
||||
'nova': {
|
||||
'DEFAULT': default_config,
|
||||
'compute': compute_config if compute_config else None,
|
||||
'vnc': vnc_config,
|
||||
'libvirt': libvirt_config,
|
||||
'pci': pci_config if pci_config else None
|
||||
'pci': pci_config if pci_config else None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue