Merge "adding compute/cpu_shared_set option"
This commit is contained in:
commit
a39ca756ea
@ -199,6 +199,14 @@ options:
|
|||||||
Sets vcpu_pin_set option in nova.conf which defines which pcpus that
|
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
|
instance vcpus can or cannot use. For example '^0,^2' to reserve two
|
||||||
cpus for the host.
|
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:
|
virtio-net-tx-queue-size:
|
||||||
type: int
|
type: int
|
||||||
default:
|
default:
|
||||||
|
@ -253,6 +253,9 @@ class NovaComputeLibvirtContext(context.OSContextGenerator):
|
|||||||
if config('vcpu-pin-set'):
|
if config('vcpu-pin-set'):
|
||||||
ctxt['vcpu_pin_set'] = 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'):
|
if config('virtio-net-tx-queue-size'):
|
||||||
ctxt['virtio_net_tx_queue_size'] = (
|
ctxt['virtio_net_tx_queue_size'] = (
|
||||||
config('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-serial-console" %}
|
||||||
|
|
||||||
{% include "parts/section-placement" %}
|
{% include "parts/section-placement" %}
|
||||||
|
|
||||||
|
[compute]
|
||||||
|
{% if cpu_shared_set -%}
|
||||||
|
cpu_shared_set = {{ cpu_shared_set }}
|
||||||
|
{% endif -%}
|
||||||
|
|
||||||
|
@ -439,6 +439,7 @@ class NovaComputeContextTests(CharmTestCase):
|
|||||||
self.test_config.set('pci-passthrough-whitelist', 'mypcidevices')
|
self.test_config.set('pci-passthrough-whitelist', 'mypcidevices')
|
||||||
self.test_config.set('virtio-net-tx-queue-size', 512)
|
self.test_config.set('virtio-net-tx-queue-size', 512)
|
||||||
self.test_config.set('virtio-net-rx-queue-size', 1024)
|
self.test_config.set('virtio-net-rx-queue-size', 1024)
|
||||||
|
self.test_config.set('cpu-shared-set', "4-12,^8,15")
|
||||||
libvirt = context.NovaComputeLibvirtContext()
|
libvirt = context.NovaComputeLibvirtContext()
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
@ -455,7 +456,8 @@ class NovaComputeContextTests(CharmTestCase):
|
|||||||
'force_raw_images': True,
|
'force_raw_images': True,
|
||||||
'pci_passthrough_whitelist': 'mypcidevices',
|
'pci_passthrough_whitelist': 'mypcidevices',
|
||||||
'virtio_net_tx_queue_size': 512,
|
'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):
|
def test_ksm_configs(self):
|
||||||
self.lsb_release.return_value = {'DISTRIB_CODENAME': 'lucid'}
|
self.lsb_release.return_value = {'DISTRIB_CODENAME': 'lucid'}
|
||||||
|
Loading…
Reference in New Issue
Block a user