Browse Source

Add scheduler workers support

The configuration option scheduler/workers was added
in Rocky [1]. This patch adds the nova::scheduler::workers
parameter which can be used to set this new config option.

[1] https://docs.openstack.org/releasenotes/nova/rocky.html

Change-Id: I217444b2c30d62347cd9e25def769e94d12a70fc
changes/65/605065/4
Tobias Urdin 4 years ago committed by Alex Schultz
parent
commit
3878df1f36
  1. 6
      manifests/scheduler.pp
  2. 5
      releasenotes/notes/scheduler-workers-13c4cdee9f6de5da.yaml
  3. 14
      spec/classes/nova_scheduler_spec.rb

6
manifests/scheduler.pp

@ -16,6 +16,10 @@
# (optional) The state of the scheduler package
# Defaults to 'present'
#
# [*workers*]
# (optional) The amount of scheduler workers.
# Defaults to $::os_workers
#
# [*scheduler_driver*]
# (optional) Default driver to use for the scheduler
# Defaults to 'filter_scheduler'
@ -29,6 +33,7 @@ class nova::scheduler(
$enabled = true,
$manage_service = true,
$ensure_package = 'present',
$workers = $::os_workers,
$scheduler_driver = 'filter_scheduler',
$discover_hosts_in_cells_interval = $::os_service_default,
) {
@ -46,6 +51,7 @@ class nova::scheduler(
}
nova_config {
'scheduler/workers': value => $workers;
'scheduler/driver': value => $scheduler_driver;
'scheduler/discover_hosts_in_cells_interval': value => $discover_hosts_in_cells_interval;
}

5
releasenotes/notes/scheduler-workers-13c4cdee9f6de5da.yaml

@ -0,0 +1,5 @@
---
features:
- |
Added new parameter nova::scheduler::workers which can be used to set the
amount of scheduler workers.

14
spec/classes/nova_scheduler_spec.rb

@ -8,7 +8,6 @@ describe 'nova::scheduler' do
shared_examples 'nova-scheduler' do
it { is_expected.to contain_package('nova-scheduler').with(
:name => platform_params[:scheduler_package_name],
:ensure => 'present'
@ -20,6 +19,7 @@ describe 'nova::scheduler' do
:ensure => 'running'
)}
it { is_expected.to contain_nova_config('scheduler/workers').with_value(4) }
it { is_expected.to contain_nova_config('scheduler/driver').with_value('filter_scheduler') }
it { is_expected.to contain_nova_config('scheduler/discover_hosts_in_cells_interval').with_value('<SERVICE DEFAULT>') }
@ -42,6 +42,14 @@ describe 'nova::scheduler' do
)}
end
context 'with workers' do
let :params do
{ :workers => 8 }
end
it { is_expected.to contain_nova_config('scheduler/workers').with_value(8) }
end
context 'with scheduler driver' do
let :params do
{ :scheduler_driver => 'custom driver' }
@ -89,7 +97,7 @@ describe 'nova::scheduler' do
context 'on Debian platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'Debian' })
@default_facts.merge({ :osfamily => 'Debian', :os_workers => 4 })
end
let :platform_params do
@ -102,7 +110,7 @@ describe 'nova::scheduler' do
context 'on Redhat platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
@default_facts.merge({ :osfamily => 'RedHat', :os_workers => 4 })
end
let :platform_params do

Loading…
Cancel
Save