diff --git a/config.yaml b/config.yaml index 1950b9f6..cd3d497b 100644 --- a/config.yaml +++ b/config.yaml @@ -193,6 +193,15 @@ 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. + worker-multiplier: + type: float + default: + description: | + The CPU core multiplier to use when configuring worker processes for + this services e.g. metadata-api. By default, the number of workers for + each daemon is set to twice the number of CPU cores a service unit has. + When deployed in a LXD container, this default value will be capped to 4 + workers unless this configuration option is set. # Required if using FlatManager (nova-network) bridge-interface: type: string diff --git a/hooks/nova_compute_utils.py b/hooks/nova_compute_utils.py index 0ea56020..e6f8cb7d 100644 --- a/hooks/nova_compute_utils.py +++ b/hooks/nova_compute_utils.py @@ -231,7 +231,8 @@ BASE_RESOURCE_MAP = { context.LogLevelContext(), context.InternalEndpointContext(), SerialConsoleContext(), - NovaComputeAvailabilityZoneContext()], + NovaComputeAvailabilityZoneContext(), + context.WorkerConfigContext()], }, NOVA_API_AA_PROFILE_PATH: { 'services': ['nova-api'], diff --git a/templates/icehouse/nova.conf b/templates/icehouse/nova.conf index a0199571..03ea9352 100644 --- a/templates/icehouse/nova.conf +++ b/templates/icehouse/nova.conf @@ -43,6 +43,7 @@ glance_api_servers = {{ glance_api_servers }} neutron_metadata_proxy_shared_secret = {{ metadata_shared_secret }} service_neutron_metadata_proxy=True {% endif -%} +metadata_workers = {{ workers }} {% if console_vnc_type -%} vnc_enabled = True diff --git a/templates/kilo/nova.conf b/templates/kilo/nova.conf index 6a2d9343..a366a1bb 100644 --- a/templates/kilo/nova.conf +++ b/templates/kilo/nova.conf @@ -145,6 +145,7 @@ metadata_proxy_shared_secret = {{ metadata_shared_secret }} service_metadata_proxy=True {% endif -%} {% endif -%} +metadata_workers = {{ workers }} {% endif -%} {% if glance_api_servers -%} diff --git a/templates/liberty/nova.conf b/templates/liberty/nova.conf index 7ca4a46d..fbdcc2a5 100644 --- a/templates/liberty/nova.conf +++ b/templates/liberty/nova.conf @@ -153,6 +153,7 @@ metadata_proxy_shared_secret = {{ metadata_shared_secret }} service_metadata_proxy=True {% endif -%} {% endif -%} +metadata_workers = {{ workers }} {% endif -%} {% include "section-keystone-authtoken" %} diff --git a/templates/mitaka/nova.conf b/templates/mitaka/nova.conf index b8e1342d..a91d3c38 100644 --- a/templates/mitaka/nova.conf +++ b/templates/mitaka/nova.conf @@ -160,6 +160,7 @@ metadata_proxy_shared_secret = {{ metadata_shared_secret }} service_metadata_proxy=True {% endif -%} {% endif -%} +metadata_workers = {{ workers }} {% endif -%} {% include "section-keystone-authtoken-mitaka" %} diff --git a/templates/ocata/nova.conf b/templates/ocata/nova.conf index c91ba2b2..75f9bfbc 100644 --- a/templates/ocata/nova.conf +++ b/templates/ocata/nova.conf @@ -160,6 +160,7 @@ metadata_proxy_shared_secret = {{ metadata_shared_secret }} service_metadata_proxy=True {% endif -%} {% endif -%} +metadata_workers = {{ workers }} {% endif -%} {% include "section-keystone-authtoken-mitaka" %}