From 3b961af09c949382ca267b67f4baa0c8160602f9 Mon Sep 17 00:00:00 2001 From: Rajesh Tailor Date: Fri, 15 May 2020 11:37:10 +0530 Subject: [PATCH] Add parameter for `query_placement_for_availability_zone` Add new parameter `scheduler/query_placement_for_availability_zone` that allows the scheduler to look up a host aggregate with metadata key of availability zone set to the value provided by incoming request, and request result from placement be limited to that aggregate. Conflicts: manifests/scheduler.pp spec/classes/nova_scheduler_spec.rb Resolved conflict occured due to missing change Iefb7e8a4d867b8721cdb5b00c2f71b2dd3a492c0 Change-Id: Ie02c732d9d75e1d5783f2aa841f244c9bee695ed (cherry picked from commit 8ffc47e48ea42bb2c967e844a2ce316d592ab0ee) (cherry picked from commit 2ebc3195c302a316fcf0eda0d262cc214e818b05) (cherry picked from commit 74473423a0bbca779d85b2ac0572f2552bdcedf9) --- manifests/scheduler.pp | 9 +++++++++ ...placement_for_availability_zone-701dcf6b0662351e.yaml | 8 ++++++++ spec/classes/nova_scheduler_spec.rb | 9 +++++++++ 3 files changed, 26 insertions(+) create mode 100644 releasenotes/notes/nova_scheduler_query_placement_for_availability_zone-701dcf6b0662351e.yaml diff --git a/manifests/scheduler.pp b/manifests/scheduler.pp index 0d60110ce..66586c369 100644 --- a/manifests/scheduler.pp +++ b/manifests/scheduler.pp @@ -44,6 +44,13 @@ # If all tenants should be confined via aggregate, then this should be True. # Defaults to $::os_service_default # +# [*query_placement_for_availability_zone*] +# (Optional) This setting allows the scheduler to look up a host aggregate +# with metadata key of availability zone set to the value provided by +# incoming request, and request result from placement be limited to that +# aggregate. +# Defaults to $::os_service_default +# class nova::scheduler( $enabled = true, $manage_service = true, @@ -53,6 +60,7 @@ class nova::scheduler( $discover_hosts_in_cells_interval = $::os_service_default, $limit_tenants_to_placement_aggregate = $::os_service_default, $placement_aggregate_required_for_tenants = $::os_service_default, + $query_placement_for_availability_zone = $::os_service_default, ) { include ::nova::deps @@ -74,6 +82,7 @@ class nova::scheduler( 'scheduler/discover_hosts_in_cells_interval': value => $discover_hosts_in_cells_interval; 'scheduler/limit_tenants_to_placement_aggregate': value => $limit_tenants_to_placement_aggregate; 'scheduler/placement_aggregate_required_for_tenants': value => $placement_aggregate_required_for_tenants; + 'scheduler/query_placement_for_availability_zone': value => $query_placement_for_availability_zone; } } diff --git a/releasenotes/notes/nova_scheduler_query_placement_for_availability_zone-701dcf6b0662351e.yaml b/releasenotes/notes/nova_scheduler_query_placement_for_availability_zone-701dcf6b0662351e.yaml new file mode 100644 index 000000000..17d221ef2 --- /dev/null +++ b/releasenotes/notes/nova_scheduler_query_placement_for_availability_zone-701dcf6b0662351e.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + Add parameter `query_placement_for_availability_zone` that allows the + scheduler to look up a host aggregate with metadata key of availability + zone set to the value provided by incoming request, and request result + from placement be limited to that aggregate. + Default value for this parameter is false. diff --git a/spec/classes/nova_scheduler_spec.rb b/spec/classes/nova_scheduler_spec.rb index 6310a71a9..5d766e862 100644 --- a/spec/classes/nova_scheduler_spec.rb +++ b/spec/classes/nova_scheduler_spec.rb @@ -24,6 +24,7 @@ describe 'nova::scheduler' do it { is_expected.to contain_nova_config('scheduler/discover_hosts_in_cells_interval').with_value('') } it { is_expected.to contain_nova_config('scheduler/limit_tenants_to_placement_aggregate').with_value('')} it { is_expected.to contain_nova_config('scheduler/placement_aggregate_required_for_tenants').with_value('') } + it { is_expected.to contain_nova_config('scheduler/query_placement_for_availability_zone').with_value('') } it { is_expected.to contain_class('nova::availability_zone') } @@ -86,6 +87,14 @@ describe 'nova::scheduler' do it { is_expected.to contain_nova_config('scheduler/placement_aggregate_required_for_tenants').with_value(true) } end + context 'with query_placement_for_availability_zone' do + let :params do + { :query_placement_for_availability_zone => true } + end + + it { is_expected.to contain_nova_config('scheduler/query_placement_for_availability_zone').with_value(true) } + end + context 'with default database parameters' do let :pre_condition do "include nova"