Simplify scheduler filter additions

Add 'nova_scheduler_extra_filters' to allow operators to enable
additional scheduler filters without overriding the entire list of
filters as in [0].

This also reduces the burden on ops to maintain the list of overridden
default schedulers because of things like [1].

[0] 3886dbc40d/openstack_deploy/user_variables.yml (L51-L69)
[1] https://review.openstack.org/#/c/596502/

Change-Id: I9ab6bcbef2b496df7f6ecf11a7d8f5f7891aeeca
This commit is contained in:
Logan V 2019-04-04 15:49:29 -05:00 committed by Jonathan Rosser
parent 980a319ec3
commit 4f993fdd8e
4 changed files with 33 additions and 11 deletions

View File

@ -311,16 +311,18 @@ nova_reserved_host_disk_mb: 2048
nova_scheduler_host_subset_size: 10
nova_scheduler_max_attempts: 5
nova_scheduler_default_filters: >-
AvailabilityZoneFilter,
ComputeFilter,
AggregateNumInstancesFilter,
AggregateIoOpsFilter,
ComputeCapabilitiesFilter,
ImagePropertiesFilter,
ServerGroupAntiAffinityFilter,
ServerGroupAffinityFilter,
NUMATopologyFilter
nova_scheduler_default_filters:
- AvailabilityZoneFilter
- ComputeFilter
- AggregateNumInstancesFilter
- AggregateIoOpsFilter
- ComputeCapabilitiesFilter
- ImagePropertiesFilter
- ServerGroupAntiAffinityFilter
- ServerGroupAffinityFilter
- NUMATopologyFilter
nova_scheduler_extra_filters: []
# This should be tuned depending on the number of compute hosts present in the
# deployment. Large clouds may wish to disable automatic discovery by setting

View File

@ -0,0 +1,11 @@
---
features:
- |
Added variable `nova_scheduler_extra_filters` which allows to extend
list of defaulted `nova_scheduler_default_filters`
upgrade:
- |
String value of `nova_scheduler_default_filters` is converted to the list
At the moment there is compatability for overriden values, that are string,
but this support will be removed in the future releases. So deployers are
recommended to replace their string overrides with list ones.

View File

@ -274,7 +274,7 @@ discover_hosts_in_cells_interval = {{ nova_discover_hosts_in_cells_interval }}
[filter_scheduler]
max_io_ops_per_host = {{ nova_max_io_ops_per_host }}
ram_weight_multiplier = {{ nova_ram_weight_multiplier }}
enabled_filters = {{ nova_scheduler_default_filters }}
enabled_filters = {{ _nova_scheduler_filters | join(',') }}
host_subset_size = {{ nova_scheduler_host_subset_size }}
tracks_instance_changes = {{ nova_scheduler_tracks_instance_changes }}

View File

@ -93,3 +93,12 @@ nova_core_files:
owner: "root"
group: "{{ nova_system_group_name }}"
mode: "0640"
_nova_scheduler_filters: |-
{% set default_filters = nova_scheduler_default_filters %}
{% if default_filters is not iterable and default_filters is string %}
{% set filters = default_filters.split(',') %}
{% else %}
{% set filters = default_filters %}
{% endif %}
{{ default_filters + nova_scheduler_extra_filters }}