Tune up report and downtime intervals for l2 agent

If the neutron server erroneously thinks than the l2 agent is down
it will fail to bind a port, which can lead to VM's spawn errors.

This patch aims to add support for agent checks flags.

Change-Id: If047c5d52d10a8ca9b1b765400bdd99a29550b1e
Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
Emilien Macchi 2013-12-24 20:13:55 +01:00
parent 691e8d7552
commit 30885efc1f
2 changed files with 20 additions and 2 deletions
manifests
spec/classes

@ -88,6 +88,16 @@
# The parent process manages them.
# Defaults to: 0
#
# [*agent_down_time*]
# (optional) Seconds to regard the agent as down; should be at least twice
# report_interval, to be sure the agent is down for good.
# Defaults to: 9
#
# [*report_interval*]
# (optional) Seconds between nodes reporting state to server; should be less than
# agent_down_time, best if it is half or less than agent_down_time.
# Defaults to: 4
#
class neutron::server (
$package_ensure = 'present',
@ -111,7 +121,9 @@ class neutron::server (
$retry_interval = '10',
$log_file = false,
$log_dir = '/var/log/neutron',
$api_workers = '0'
$api_workers = '0',
$agent_down_time = '9',
$report_interval = '4'
) {
include neutron::params
@ -167,6 +179,8 @@ class neutron::server (
neutron_config {
'DEFAULT/api_workers': value => $api_workers;
'DEFAULT/agent_down_time': value => $agent_down_time;
'DEFAULT/report_interval': value => $report_interval;
'database/connection': value => $connection_real;
'database/idle_timeout': value => $idle_timeout_real;
'database/retry_interval': value => $retry_interval_real;

@ -28,7 +28,9 @@ describe 'neutron::server' do
:idle_timeout => '3600',
:reconnect_interval => '10',
:retry_interval => '10',
:api_workers => '0'}
:api_workers => '0',
:agent_down_time => '9',
:report_interval => '4'}
end
shared_examples_for 'a neutron server' do
@ -84,6 +86,8 @@ describe 'neutron::server' do
:ensure => 'absent'
)
should contain_neutron_config('DEFAULT/api_workers').with_value('0')
should contain_neutron_config('DEFAULT/agent_down_time').with_value('9')
should contain_neutron_config('DEFAULT/report_interval').with_value('4')
end
end