adding compute/cpu_shared_set option
For Rocky, Nova introduced compute/cpu_shared_set and libvirt driver uses that option to specify set of pCPUs which will be used to put emulator threads on. So guest vCPUs can be pinned on pCPUs which will be entirely dedicated for them. Change-Id: I88b2afda67a91266f21d2c870a76646262488db2 Closes-Bug: 1806434 Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
This commit is contained in:
parent
27e71b5e41
commit
0cd3cee728
|
@ -187,6 +187,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:
|
||||
|
|
|
@ -247,6 +247,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'))
|
||||
|
|
|
@ -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 -%}
|
||||
|
||||
|
|
|
@ -398,6 +398,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(
|
||||
|
@ -414,7 +415,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'}
|
||||
|
|
Loading…
Reference in New Issue