summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Tantsur <divius.inside@gmail.com>2017-06-13 17:53:50 +0200
committerDmitry Tantsur <divius.inside@gmail.com>2017-06-14 09:21:51 +0000
commitef267d195231f6cd3f5bcd4c15b4d196338a88b4 (patch)
treebcf9747a639a87883e381f67994113ffbdae54ea
parentbcc5f6a1c6bc69fafdf7de74a1823b949217130a (diff)
Expose nova::scheduler::discover_hosts_in_cells_interval option
Starting with the Ocata release, bare metal nodes are no longer get recognized by nova automatically. To avoid forcing users into running nova manage command each time they enroll a node, we will have to allow enable the periodic task to do so. This option configures it. Change-Id: I1f0e40474018de593cb3f8798b5212285f5629a4 Closes-Bug: #1697724 (cherry picked from commit 8c8d795067b5a09d029a263683d35e15a8c43b37)
Notes
Notes (review): Code-Review+2: Emilien Macchi <emilien@redhat.com> Code-Review+2: Alex Schultz <aschultz@redhat.com> Workflow+1: Alex Schultz <aschultz@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 15 Jun 2017 21:52:58 +0000 Reviewed-on: https://review.openstack.org/474133 Project: openstack/puppet-nova Branch: refs/heads/stable/ocata
-rw-r--r--manifests/scheduler.pp17
-rw-r--r--releasenotes/notes/discover_hosts_in_cells_interval-fcee1903fdaa4684.yaml6
-rw-r--r--spec/classes/nova_scheduler_spec.rb9
3 files changed, 27 insertions, 5 deletions
diff --git a/manifests/scheduler.pp b/manifests/scheduler.pp
index 61fe915..a7f0d47 100644
--- a/manifests/scheduler.pp
+++ b/manifests/scheduler.pp
@@ -20,11 +20,17 @@
20# (optional) Default driver to use for the scheduler 20# (optional) Default driver to use for the scheduler
21# Defaults to 'filter_scheduler' 21# Defaults to 'filter_scheduler'
22# 22#
23# [*discover_hosts_in_cells_interval*]
24# (optional) This value controls how often (in seconds) the scheduler should
25# attept to discover new hosts that have been added to cells.
26# Defaults to $::os_service_default
27#
23class nova::scheduler( 28class nova::scheduler(
24 $enabled = true, 29 $enabled = true,
25 $manage_service = true, 30 $manage_service = true,
26 $ensure_package = 'present', 31 $ensure_package = 'present',
27 $scheduler_driver = 'filter_scheduler', 32 $scheduler_driver = 'filter_scheduler',
33 $discover_hosts_in_cells_interval = $::os_service_default,
28) { 34) {
29 35
30 include ::nova::deps 36 include ::nova::deps
@@ -40,7 +46,8 @@ class nova::scheduler(
40 } 46 }
41 47
42 nova_config { 48 nova_config {
43 'scheduler/driver': value => $scheduler_driver; 49 'scheduler/driver': value => $scheduler_driver;
50 'scheduler/discover_hosts_in_cells_interval': value => $discover_hosts_in_cells_interval;
44 } 51 }
45 52
46 # TODO(aschultz): old options, remove in P 53 # TODO(aschultz): old options, remove in P
diff --git a/releasenotes/notes/discover_hosts_in_cells_interval-fcee1903fdaa4684.yaml b/releasenotes/notes/discover_hosts_in_cells_interval-fcee1903fdaa4684.yaml
new file mode 100644
index 0000000..40b17b9
--- /dev/null
+++ b/releasenotes/notes/discover_hosts_in_cells_interval-fcee1903fdaa4684.yaml
@@ -0,0 +1,6 @@
1---
2features:
3 - |
4 Expose the ``discover_hosts_in_cells_interval`` option in the scheduler
5 manifest. Changing this option is needed for bare metal clouds starting
6 with the Ocata release.
diff --git a/spec/classes/nova_scheduler_spec.rb b/spec/classes/nova_scheduler_spec.rb
index ad1c6e1..38d6486 100644
--- a/spec/classes/nova_scheduler_spec.rb
+++ b/spec/classes/nova_scheduler_spec.rb
@@ -22,6 +22,7 @@ describe 'nova::scheduler' do
22 22
23 it { is_expected.to contain_nova_config('DEFAULT/scheduler_driver').with_ensure('absent') } 23 it { is_expected.to contain_nova_config('DEFAULT/scheduler_driver').with_ensure('absent') }
24 it { is_expected.to contain_nova_config('scheduler/driver').with_value('filter_scheduler') } 24 it { is_expected.to contain_nova_config('scheduler/driver').with_value('filter_scheduler') }
25 it { is_expected.to contain_nova_config('scheduler/discover_hosts_in_cells_interval').with_value('<SERVICE DEFAULT>') }
25 26
26 context 'with manage_service as false' do 27 context 'with manage_service as false' do
27 let :params do 28 let :params do
@@ -50,6 +51,14 @@ describe 'nova::scheduler' do
50 it { is_expected.to contain_nova_config('scheduler/driver').with_value('custom driver') } 51 it { is_expected.to contain_nova_config('scheduler/driver').with_value('custom driver') }
51 end 52 end
52 53
54 context 'with discover_hosts_in_cells_interval' do
55 let :params do
56 { :discover_hosts_in_cells_interval => 15 }
57 end
58
59 it { is_expected.to contain_nova_config('scheduler/discover_hosts_in_cells_interval').with_value(15) }
60 end
61
53 context 'with default database parameters' do 62 context 'with default database parameters' do
54 let :pre_condition do 63 let :pre_condition do
55 "include nova" 64 "include nova"