Add new config option to set host_subset_size

A new config option called scheduler-host-subset-size was added
to configure FilterScheduler's host_subset_size property, which
size of the subset of best hosts selected by the scheduler.

Change-Id: Ic61917732d50806f74be0b4e7c87a51d738afbe7
Closes-bug: #1846203
This commit is contained in:
tpsilva 2019-10-04 18:45:55 -03:00
parent f7f6fa295c
commit bc1d19b680
5 changed files with 28 additions and 0 deletions

View File

@ -591,3 +591,17 @@ options:
override YAML files in the service's policy.d directory. The resource
file should be a ZIP file containing at least one yaml file with a .yaml
or .yml extension. If False then remove the overrides.
scheduler-host-subset-size:
type: int
default:
description: |
The value to be configured for the host_subset_size property on
FilterScheduler. This property sets the size of the subset of best hosts
selected by the scheduler.
.
When a new instance is created, it will be scheduled on a host chosen
randomly from a subset of the best hosts with the size set by this
property.
.
Possible Values are positive integers. Any value less than 1 will be
treated as 1.

View File

@ -387,6 +387,8 @@ class NovaConfigContext(ch_context.WorkerConfigContext):
ctxt['console_access_protocol'] = hookenv.config(
'console-access-protocol')
ctxt['console_access_port'] = hookenv.config('console-access-port')
ctxt['scheduler_host_subset_size'] = hookenv.config(
'scheduler-host-subset-size')
return ctxt

View File

@ -193,6 +193,10 @@ enabled_filters = {{ scheduler_default_filters }},{{ additional_neutron_filters
enabled_filters = {{ scheduler_default_filters }}
{% endif %}
{%- if scheduler_host_subset_size %}
host_subset_size = {{ scheduler_host_subset_size }}
{%- endif %}
[api]
auth_strategy=keystone
{% if vendor_data or vendor_data_url -%}

View File

@ -208,6 +208,10 @@ enabled_filters = {{ scheduler_default_filters }}
# https://bugs.launchpad.net/charm-nova-cloud-controller/+bug/1818239
build_failure_weight_multiplier = 0.0
{%- if scheduler_host_subset_size %}
host_subset_size = {{ scheduler_host_subset_size }}
{%- endif %}
[api]
auth_strategy=keystone
{% if vendor_data or vendor_data_url -%}

View File

@ -214,6 +214,10 @@ enabled_filters = {{ scheduler_default_filters }}
# https://bugs.launchpad.net/charm-nova-cloud-controller/+bug/1818239
build_failure_weight_multiplier = 0.0
{%- if scheduler_host_subset_size %}
host_subset_size = {{ scheduler_host_subset_size }}
{%- endif %}
[api]
auth_strategy=keystone
{% if vendor_data or vendor_data_url -%}