Merge "adding compute/cpu_shared_set option"

This commit is contained in:
Zuul 2018-12-11 14:56:21 +00:00 committed by Gerrit Code Review
commit a39ca756ea
4 changed files with 20 additions and 1 deletions

View File

@ -199,6 +199,14 @@ options:
Sets vcpu_pin_set option in nova.conf which defines which pcpus that
instance vcpus can or cannot use. For example '^0,^2' to reserve two
cpus for the host.
cpu-shared-set:
type: string
default:
description: |
Sets compute/cpu_shared_set option in nova.conf defines which
physical CPUs will be used for best-effort guest vCPU resources.
Currently only used by libvirt driver to place guest emulator threads
when hw:emulator_threads_policy:share is set.
virtio-net-tx-queue-size:
type: int
default:

View File

@ -253,6 +253,9 @@ class NovaComputeLibvirtContext(context.OSContextGenerator):
if config('vcpu-pin-set'):
ctxt['vcpu_pin_set'] = config('vcpu-pin-set')
if config('cpu-shared-set'):
ctxt['cpu_shared_set'] = config('cpu-shared-set')
if config('virtio-net-tx-queue-size'):
ctxt['virtio_net_tx_queue_size'] = (
config('virtio-net-tx-queue-size'))

View File

@ -264,3 +264,9 @@ disable_libvirt_livesnapshot = False
{% include "parts/section-serial-console" %}
{% include "parts/section-placement" %}
[compute]
{% if cpu_shared_set -%}
cpu_shared_set = {{ cpu_shared_set }}
{% endif -%}

View File

@ -439,6 +439,7 @@ class NovaComputeContextTests(CharmTestCase):
self.test_config.set('pci-passthrough-whitelist', 'mypcidevices')
self.test_config.set('virtio-net-tx-queue-size', 512)
self.test_config.set('virtio-net-rx-queue-size', 1024)
self.test_config.set('cpu-shared-set', "4-12,^8,15")
libvirt = context.NovaComputeLibvirtContext()
self.assertEqual(
@ -455,7 +456,8 @@ class NovaComputeContextTests(CharmTestCase):
'force_raw_images': True,
'pci_passthrough_whitelist': 'mypcidevices',
'virtio_net_tx_queue_size': 512,
'virtio_net_rx_queue_size': 1024}, libvirt())
'virtio_net_rx_queue_size': 1024,
'cpu_shared_set': "4-12,^8,15"}, libvirt())
def test_ksm_configs(self):
self.lsb_release.return_value = {'DISTRIB_CODENAME': 'lucid'}