From ffbd0a1aafe97b406a0f89afb14cf8b0a20a47d1 Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Fri, 15 Feb 2019 16:06:51 +0100 Subject: [PATCH] Introduce cinder_scheduler_default_filters Operators may want to define specific default filters. Previously, they could only do so via cinder_cinder_conf_overrides. Make the cinder.conf template understand cinder_scheduler_default_filters, a list variable that, if defined, is folded into a comma-separated list for scheduler_default_filters in the [DEFAULT] section. Change-Id: I12859167d19b9f40e3378ac08fed094a42f40bc7 --- ...le-scheduler-filters-17ea2ed9d4aa0708.yaml | 25 +++++++++++++++++++ templates/cinder.conf.j2 | 6 +++++ 2 files changed, 31 insertions(+) create mode 100644 releasenotes/notes/configurable-scheduler-filters-17ea2ed9d4aa0708.yaml diff --git a/releasenotes/notes/configurable-scheduler-filters-17ea2ed9d4aa0708.yaml b/releasenotes/notes/configurable-scheduler-filters-17ea2ed9d4aa0708.yaml new file mode 100644 index 00000000..e69700a0 --- /dev/null +++ b/releasenotes/notes/configurable-scheduler-filters-17ea2ed9d4aa0708.yaml @@ -0,0 +1,25 @@ +--- +features: + - | + The list of enabled filters for the Cinder scheduler, + `scheduler_default_filters` in `cinder.conf`, could previously be + defined only via an entry in ``cinder_cinder_conf_overrides``. You now + have the option to instead define a list variable, + ``cinder_scheduler_default_filters``, that defines the enabled + filters. This is helpful if you either want to disable one of the + filters enabled by default (at the time of writing, these are + `AvailabilityZoneFilter`, `CapacityFilter`, and + `CapabilitiesFilter`), or if conversely you want to add a filter + that is normally not enabled, such as `DifferentBackendFilter` or + `InstanceLocalityFilter`. + + For example, to enable the `InstanceLocalityFilter` in addition to + the normally enabled scheduler filters, use the following variable. + + .. code-block:: yaml + + cinder_scheduler_default_filters: + - AvailabilityZoneFilter + - CapacityFilter + - CapabilitiesFilter + - InstanceLocalityFilter \ No newline at end of file diff --git a/templates/cinder.conf.j2 b/templates/cinder.conf.j2 index 910d168d..7feba717 100644 --- a/templates/cinder.conf.j2 +++ b/templates/cinder.conf.j2 @@ -17,6 +17,12 @@ auth_strategy = {{ cinder_auth_strategy }} ## Cinder API's enabled {% if cinder_services['cinder-volume']['group'] in group_names %} {% if cinder_service_backup_program_enabled == true %} + +## Cinder Scheduler +{% if cinder_scheduler_default_filters is defined %} +scheduler_default_filters={{ cinder_scheduler_default_filters | join(',') }} +{% endif %} + ## Cinder Backup backup_driver = {{ cinder_service_backup_driver }} backup_metadata_version = {{ cinder_service_backup_metadata_version }}