From b89fd34472078627e89c66969e3375a690b023d0 Mon Sep 17 00:00:00 2001 From: Tri Hoang Vo Date: Wed, 9 Apr 2014 16:37:20 +0200 Subject: [PATCH] fix wrong location of report_interval 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 --- manifests/init.pp | 9 +++++++++ manifests/server.pp | 14 +++++++------- spec/classes/neutron_init_spec.rb | 4 +++- spec/classes/neutron_server_spec.rb | 2 -- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 8ff36b073..973b38f0a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 @@ -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, @@ -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 { diff --git a/manifests/server.pp b/manifests/server.pp index e04d7eb38..48098ed15 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -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 @@ -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 @@ -171,6 +167,7 @@ $retry_interval = undef, $log_dir = undef, $log_file = undef, + $report_interval = undef, ) { include neutron::params @@ -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 { @@ -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; diff --git a/spec/classes/neutron_init_spec.rb b/spec/classes/neutron_init_spec.rb index 5fb6c2ea7..468ffb5c1 100644 --- a/spec/classes/neutron_init_spec.rb +++ b/spec/classes/neutron_init_spec.rb @@ -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 @@ -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 diff --git a/spec/classes/neutron_server_spec.rb b/spec/classes/neutron_server_spec.rb index dbc41d7a5..53f6a30a7 100644 --- a/spec/classes/neutron_server_spec.rb +++ b/spec/classes/neutron_server_spec.rb @@ -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 @@ -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