Merge "Set allow_automatic_l3agent_failover in neutron.conf instead of l3_agent.ini"
This commit is contained in:
commit
8946a0e99b
@ -100,11 +100,7 @@
|
||||
# Defaults to 'legacy'
|
||||
#
|
||||
# [*allow_automatic_l3agent_failover*]
|
||||
# (optional) Automatically reschedule routers from offline L3 agents to online
|
||||
# L3 agents.
|
||||
# This is another way to run virtual routers in highly available way but with slow
|
||||
# failover performances compared to Keepalived feature in Neutron L3 Agent.
|
||||
# Defaults to 'False'
|
||||
# DEPRECATED: Has no effect in this class. Use the same parameter in neutron::server instead.
|
||||
#
|
||||
class neutron::agents::l3 (
|
||||
$package_ensure = 'present',
|
||||
@ -129,6 +125,7 @@ class neutron::agents::l3 (
|
||||
$ha_vrrp_auth_password = undef,
|
||||
$ha_vrrp_advert_int = '3',
|
||||
$agent_mode = 'legacy',
|
||||
# DEPRECATED PARAMETERS
|
||||
$allow_automatic_l3agent_failover = false,
|
||||
) {
|
||||
|
||||
@ -137,6 +134,10 @@ class neutron::agents::l3 (
|
||||
Neutron_config<||> ~> Service['neutron-l3']
|
||||
Neutron_l3_agent_config<||> ~> Service['neutron-l3']
|
||||
|
||||
if $allow_automatic_l3agent_failover {
|
||||
notice('parameter allow_automatic_l3agent_failover is deprecated, use parameter in neutron::server instead')
|
||||
}
|
||||
|
||||
if $ha_enabled {
|
||||
neutron_l3_agent_config {
|
||||
'DEFAULT/ha_vrrp_auth_type': value => $ha_vrrp_auth_type;
|
||||
@ -160,7 +161,6 @@ class neutron::agents::l3 (
|
||||
'DEFAULT/enable_metadata_proxy': value => $enable_metadata_proxy;
|
||||
'DEFAULT/router_delete_namespaces': value => $router_delete_namespaces;
|
||||
'DEFAULT/agent_mode': value => $agent_mode;
|
||||
'DEFAULT/allow_automatic_l3agent_failover': value => $allow_automatic_l3agent_failover;
|
||||
}
|
||||
|
||||
if $network_device_mtu {
|
||||
|
@ -169,6 +169,11 @@
|
||||
# Also can be the type of the router on the create request (admin-only attribute).
|
||||
# Defaults to false
|
||||
#
|
||||
# [*allow_automatic_l3agent_failover*]
|
||||
# (optional) Allow automatic rescheduling of routers from dead L3 agents with
|
||||
# admin_state_up set to True to alive agents.
|
||||
# Defaults to false
|
||||
#
|
||||
# [*l3_ha*]
|
||||
# (optional) Enable high availability for virtual routers.
|
||||
# Defaults to false
|
||||
@ -186,44 +191,45 @@
|
||||
# Defaults to '169.254.192.0/18'
|
||||
#
|
||||
class neutron::server (
|
||||
$package_ensure = 'present',
|
||||
$enabled = true,
|
||||
$manage_service = true,
|
||||
$service_name = $::neutron::params::server_service,
|
||||
$auth_password = false,
|
||||
$auth_type = 'keystone',
|
||||
$auth_tenant = 'services',
|
||||
$auth_user = 'neutron',
|
||||
$auth_uri = false,
|
||||
$identity_uri = false,
|
||||
$database_connection = 'sqlite:////var/lib/neutron/ovs.sqlite',
|
||||
$database_max_retries = 10,
|
||||
$database_idle_timeout = 3600,
|
||||
$database_retry_interval = 10,
|
||||
$database_min_pool_size = 1,
|
||||
$database_max_pool_size = 10,
|
||||
$database_max_overflow = 20,
|
||||
$sync_db = false,
|
||||
$api_workers = $::processorcount,
|
||||
$rpc_workers = $::processorcount,
|
||||
$agent_down_time = '75',
|
||||
$router_scheduler_driver = 'neutron.scheduler.l3_agent_scheduler.ChanceScheduler',
|
||||
$router_distributed = false,
|
||||
$l3_ha = false,
|
||||
$max_l3_agents_per_router = 3,
|
||||
$min_l3_agents_per_router = 2,
|
||||
$l3_ha_net_cidr = '169.254.192.0/18',
|
||||
$package_ensure = 'present',
|
||||
$enabled = true,
|
||||
$manage_service = true,
|
||||
$service_name = $::neutron::params::server_service,
|
||||
$auth_password = false,
|
||||
$auth_type = 'keystone',
|
||||
$auth_tenant = 'services',
|
||||
$auth_user = 'neutron',
|
||||
$auth_uri = false,
|
||||
$identity_uri = false,
|
||||
$database_connection = 'sqlite:////var/lib/neutron/ovs.sqlite',
|
||||
$database_max_retries = 10,
|
||||
$database_idle_timeout = 3600,
|
||||
$database_retry_interval = 10,
|
||||
$database_min_pool_size = 1,
|
||||
$database_max_pool_size = 10,
|
||||
$database_max_overflow = 20,
|
||||
$sync_db = false,
|
||||
$api_workers = $::processorcount,
|
||||
$rpc_workers = $::processorcount,
|
||||
$agent_down_time = '75',
|
||||
$router_scheduler_driver = 'neutron.scheduler.l3_agent_scheduler.ChanceScheduler',
|
||||
$router_distributed = false,
|
||||
$allow_automatic_l3agent_failover = false,
|
||||
$l3_ha = false,
|
||||
$max_l3_agents_per_router = 3,
|
||||
$min_l3_agents_per_router = 2,
|
||||
$l3_ha_net_cidr = '169.254.192.0/18',
|
||||
# DEPRECATED PARAMETERS
|
||||
$auth_host = 'localhost',
|
||||
$auth_port = '35357',
|
||||
$auth_protocol = 'http',
|
||||
$auth_admin_prefix = false,
|
||||
$mysql_module = undef,
|
||||
$log_dir = undef,
|
||||
$log_file = undef,
|
||||
$report_interval = undef,
|
||||
$state_path = undef,
|
||||
$lock_path = undef,
|
||||
$auth_host = 'localhost',
|
||||
$auth_port = '35357',
|
||||
$auth_protocol = 'http',
|
||||
$auth_admin_prefix = false,
|
||||
$mysql_module = undef,
|
||||
$log_dir = undef,
|
||||
$log_file = undef,
|
||||
$report_interval = undef,
|
||||
$state_path = undef,
|
||||
$lock_path = undef,
|
||||
) {
|
||||
|
||||
include ::neutron::params
|
||||
@ -289,18 +295,19 @@ class neutron::server (
|
||||
}
|
||||
|
||||
neutron_config {
|
||||
'DEFAULT/api_workers': value => $api_workers;
|
||||
'DEFAULT/rpc_workers': value => $rpc_workers;
|
||||
'DEFAULT/agent_down_time': value => $agent_down_time;
|
||||
'DEFAULT/router_scheduler_driver': value => $router_scheduler_driver;
|
||||
'DEFAULT/router_distributed': value => $router_distributed;
|
||||
'database/connection': value => $database_connection, secret => true;
|
||||
'database/idle_timeout': value => $database_idle_timeout;
|
||||
'database/retry_interval': value => $database_retry_interval;
|
||||
'database/max_retries': value => $database_max_retries;
|
||||
'database/min_pool_size': value => $database_min_pool_size;
|
||||
'database/max_pool_size': value => $database_max_pool_size;
|
||||
'database/max_overflow': value => $database_max_overflow;
|
||||
'DEFAULT/api_workers': value => $api_workers;
|
||||
'DEFAULT/rpc_workers': value => $rpc_workers;
|
||||
'DEFAULT/agent_down_time': value => $agent_down_time;
|
||||
'DEFAULT/router_scheduler_driver': value => $router_scheduler_driver;
|
||||
'DEFAULT/router_distributed': value => $router_distributed;
|
||||
'DEFAULT/allow_automatic_l3agent_failover': value => $allow_automatic_l3agent_failover;
|
||||
'database/connection': value => $database_connection, secret => true;
|
||||
'database/idle_timeout': value => $database_idle_timeout;
|
||||
'database/retry_interval': value => $database_retry_interval;
|
||||
'database/max_retries': value => $database_max_retries;
|
||||
'database/min_pool_size': value => $database_min_pool_size;
|
||||
'database/max_pool_size': value => $database_max_pool_size;
|
||||
'database/max_overflow': value => $database_max_overflow;
|
||||
}
|
||||
|
||||
if $state_path {
|
||||
|
@ -27,8 +27,7 @@ describe 'neutron::agents::l3' do
|
||||
:ha_vrrp_auth_type => 'PASS',
|
||||
:ha_vrrp_auth_password => nil,
|
||||
:ha_vrrp_advert_int => '3',
|
||||
:agent_mode => 'legacy',
|
||||
:allow_automatic_l3agent_failover => false }
|
||||
:agent_mode => 'legacy' }
|
||||
end
|
||||
|
||||
let :params do
|
||||
@ -57,7 +56,6 @@ describe 'neutron::agents::l3' do
|
||||
should contain_neutron_l3_agent_config('DEFAULT/enable_metadata_proxy').with_value(p[:enable_metadata_proxy])
|
||||
should contain_neutron_l3_agent_config('DEFAULT/network_device_mtu').with_ensure('absent')
|
||||
should contain_neutron_l3_agent_config('DEFAULT/router_delete_namespaces').with_value(p[:router_delete_namespaces])
|
||||
should contain_neutron_l3_agent_config('DEFAULT/allow_automatic_l3agent_failover').with_value(p[:allow_automatic_l3agent_failover])
|
||||
end
|
||||
|
||||
it 'installs neutron l3 agent package' do
|
||||
|
@ -12,28 +12,29 @@ describe 'neutron::server' do
|
||||
end
|
||||
|
||||
let :default_params do
|
||||
{ :package_ensure => 'present',
|
||||
:enabled => true,
|
||||
:auth_type => 'keystone',
|
||||
:auth_host => 'localhost',
|
||||
:auth_port => '35357',
|
||||
:auth_tenant => 'services',
|
||||
:auth_user => 'neutron',
|
||||
:database_connection => 'sqlite:////var/lib/neutron/ovs.sqlite',
|
||||
:database_max_retries => '10',
|
||||
:database_idle_timeout => '3600',
|
||||
:database_retry_interval => '10',
|
||||
:database_min_pool_size => '1',
|
||||
:database_max_pool_size => '10',
|
||||
:database_max_overflow => '20',
|
||||
:sync_db => false,
|
||||
:agent_down_time => '75',
|
||||
:router_scheduler_driver => 'neutron.scheduler.l3_agent_scheduler.ChanceScheduler',
|
||||
:router_distributed => false,
|
||||
:l3_ha => false,
|
||||
:max_l3_agents_per_router => '3',
|
||||
:min_l3_agents_per_router => '2',
|
||||
:l3_ha_net_cidr => '169.254.192.0/18'
|
||||
{ :package_ensure => 'present',
|
||||
:enabled => true,
|
||||
:auth_type => 'keystone',
|
||||
:auth_host => 'localhost',
|
||||
:auth_port => '35357',
|
||||
:auth_tenant => 'services',
|
||||
:auth_user => 'neutron',
|
||||
:database_connection => 'sqlite:////var/lib/neutron/ovs.sqlite',
|
||||
:database_max_retries => '10',
|
||||
:database_idle_timeout => '3600',
|
||||
:database_retry_interval => '10',
|
||||
:database_min_pool_size => '1',
|
||||
:database_max_pool_size => '10',
|
||||
:database_max_overflow => '20',
|
||||
:sync_db => false,
|
||||
:agent_down_time => '75',
|
||||
:router_scheduler_driver => 'neutron.scheduler.l3_agent_scheduler.ChanceScheduler',
|
||||
:router_distributed => false,
|
||||
:l3_ha => false,
|
||||
:max_l3_agents_per_router => '3',
|
||||
:min_l3_agents_per_router => '2',
|
||||
:l3_ha_net_cidr => '169.254.192.0/18',
|
||||
:allow_automatic_l3agent_failover => false
|
||||
}
|
||||
end
|
||||
|
||||
@ -169,6 +170,12 @@ describe 'neutron::server' do
|
||||
should contain_neutron_config('DEFAULT/lock_path').with_value(p[:lock_path])
|
||||
end
|
||||
end
|
||||
|
||||
context 'with allow_automatic_l3agent_failover in neutron.conf' do
|
||||
it 'should configure allow_automatic_l3agent_failover' do
|
||||
should contain_neutron_config('DEFAULT/allow_automatic_l3agent_failover').with_value(p[:allow_automatic_l3agent_failover])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples_for 'a neutron server with auth_admin_prefix set' do
|
||||
|
Loading…
Reference in New Issue
Block a user