Skip to content

Commit

Permalink
fix wrong location of report_interval
Browse files Browse the repository at this point in the history
report_interval is a config in section agent, not section DEFAULT.
It is used by the agents to scheduly report state, and not used by
neutron-server. Missing this config on agent side, leads to flapping
alive status of neutron agents. Therefore report_interval is moved
from class neutron::server to class neutron

Change-Id: I4fa84dabcba8465b297f6dc0eefa1d02a98eafca
  • Loading branch information
trihoangvo committed Apr 9, 2014
1 parent 0411563 commit b89fd34
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
9 changes: 9 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
# (optional) Enables network namespaces
# Defaults to false
#
# [*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.
# agent_down_time is a config for neutron-server, set by class neutron::server
# report_interval is a config for neutron agents, set by class neutron
# Defaults to: 30
#
# [*control_exchange*]
# (optional) What RPC queue/exchange to use
# Defaults to neutron
Expand Down Expand Up @@ -148,6 +155,7 @@
$allow_sorting = false,
$allow_overlapping_ips = false,
$root_helper = 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf',
$report_interval = '30',
$control_exchange = 'neutron',
$rpc_backend = 'neutron.openstack.common.rpc.impl_kombu',
$rabbit_password = false,
Expand Down Expand Up @@ -216,6 +224,7 @@
'DEFAULT/control_exchange': value => $control_exchange;
'DEFAULT/rpc_backend': value => $rpc_backend;
'AGENT/root_helper': value => $root_helper;
'agent/report_interval': value => $report_interval;
}

if $log_file {
Expand Down
14 changes: 7 additions & 7 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,10 @@
# [*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.
# agent_down_time is a config for neutron-server, set by class neutron::server
# report_interval is a config for neutron agents, set by class neutron
# Defaults to: 75
#
# [*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: 30
#
# [*router_scheduler_driver*]
# (optional) Driver to use for scheduling router to a default L3 agent. Could be:
# neutron.scheduler.l3_agent_scheduler.ChanceScheduler to schedule a router in a random way
Expand Down Expand Up @@ -157,7 +154,6 @@
$sync_db = false,
$api_workers = '0',
$agent_down_time = '75',
$report_interval = '30',
$router_scheduler_driver = 'neutron.scheduler.l3_agent_scheduler.ChanceScheduler',
$mysql_module = '0.9',
# DEPRECATED PARAMETERS
Expand All @@ -171,6 +167,7 @@
$retry_interval = undef,
$log_dir = undef,
$log_file = undef,
$report_interval = undef,
) {

include neutron::params
Expand Down Expand Up @@ -227,6 +224,10 @@
fail('The log_file parameter is removed, use log_file of neutron class instead.')
}

if $report_interval {
fail('The report_interval is removed, use report_interval of neutron class instead.')
}

validate_re($database_connection_real, '(sqlite|mysql|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')

case $database_connection_real {
Expand Down Expand Up @@ -269,7 +270,6 @@
neutron_config {
'DEFAULT/api_workers': value => $api_workers;
'DEFAULT/agent_down_time': value => $agent_down_time;
'DEFAULT/report_interval': value => $report_interval;
'DEFAULT/router_scheduler_driver': value => $router_scheduler_driver;
'database/connection': value => $database_connection_real;
'database/idle_timeout': value => $database_idle_timeout_real;
Expand Down
4 changes: 3 additions & 1 deletion spec/classes/neutron_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
:rabbit_user => 'guest',
:rabbit_password => 'guest',
:rabbit_virtual_host => '/',
:log_dir => '/var/log/neutron'
:log_dir => '/var/log/neutron',
:report_interval => '30',
}
end

Expand Down Expand Up @@ -109,6 +110,7 @@
should contain_neutron_config('DEFAULT/allow_overlapping_ips').with_value(false)
should contain_neutron_config('DEFAULT/control_exchange').with_value('neutron')
should contain_neutron_config('AGENT/root_helper').with_value('sudo neutron-rootwrap /etc/neutron/rootwrap.conf')
should contain_neutron_config('agent/report_interval').with_value('30')
end
end

Expand Down
2 changes: 0 additions & 2 deletions spec/classes/neutron_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
:sync_db => false,
:api_workers => '0',
:agent_down_time => '75',
:report_interval => '30',
:router_scheduler_driver => 'neutron.scheduler.l3_agent_scheduler.ChanceScheduler',
:mysql_module => '0.9'}
end
Expand Down Expand Up @@ -82,7 +81,6 @@
)
should contain_neutron_config('DEFAULT/api_workers').with_value('0')
should contain_neutron_config('DEFAULT/agent_down_time').with_value('75')
should contain_neutron_config('DEFAULT/report_interval').with_value('30')
should contain_neutron_config('DEFAULT/router_scheduler_driver').with_value('neutron.scheduler.l3_agent_scheduler.ChanceScheduler')
end

Expand Down

0 comments on commit b89fd34

Please sign in to comment.