Browse Source

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 8ffc47e48e)
(cherry picked from commit 2ebc3195c3)
(cherry picked from commit 74473423a0)
changes/21/731521/1
Rajesh Tailor 1 month ago
parent
commit
3b961af09c
3 changed files with 26 additions and 0 deletions
  1. +9
    -0
      manifests/scheduler.pp
  2. +8
    -0
      releasenotes/notes/nova_scheduler_query_placement_for_availability_zone-701dcf6b0662351e.yaml
  3. +9
    -0
      spec/classes/nova_scheduler_spec.rb

+ 9
- 0
manifests/scheduler.pp View File

@@ -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;
}

}

+ 8
- 0
releasenotes/notes/nova_scheduler_query_placement_for_availability_zone-701dcf6b0662351e.yaml View File

@@ -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.

+ 9
- 0
spec/classes/nova_scheduler_spec.rb View File

@@ -24,6 +24,7 @@ describe 'nova::scheduler' do
it { is_expected.to contain_nova_config('scheduler/discover_hosts_in_cells_interval').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('scheduler/limit_tenants_to_placement_aggregate').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_nova_config('scheduler/placement_aggregate_required_for_tenants').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('scheduler/query_placement_for_availability_zone').with_value('<SERVICE DEFAULT>') }

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"


Loading…
Cancel
Save