From 340abcde440038d166e0fc3dd5d11f74f478f5d6 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 5 Nov 2014 16:16:35 +0100 Subject: [PATCH] L3 Agent: allow to automatically reschedule virtual routers In case of L3 agent failure, allow to reschedule automatically a virtual router. It's another way to provide HA for virtual routers with medium downtime. The best way stays in using keepalived + DVR features but this parameters allows another way to provide HA. Change-Id: I0527e4a368e2b90b83877d3c7861e86674f9ae8a --- manifests/agents/l3.pp | 81 ++++++++++++++------------ spec/classes/neutron_agents_l3_spec.rb | 44 +++++++------- 2 files changed, 68 insertions(+), 57 deletions(-) diff --git a/manifests/agents/l3.pp b/manifests/agents/l3.pp index 1748c1217..55d303a30 100644 --- a/manifests/agents/l3.pp +++ b/manifests/agents/l3.pp @@ -99,29 +99,37 @@ # 'dvr_snat': enable DVR with centralized SNAT support (DVR for single-host, for testing only) # 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' +# class neutron::agents::l3 ( - $package_ensure = 'present', - $enabled = true, - $manage_service = true, - $debug = false, - $external_network_bridge = 'br-ex', - $use_namespaces = true, - $interface_driver = 'neutron.agent.linux.interface.OVSInterfaceDriver', - $router_id = undef, - $gateway_external_network_id = undef, - $handle_internal_only_routers = true, - $metadata_port = '9697', - $send_arp_for_ha = '3', - $periodic_interval = '40', - $periodic_fuzzy_delay = '5', - $enable_metadata_proxy = true, - $network_device_mtu = undef, - $router_delete_namespaces = false, - $ha_enabled = false, - $ha_vrrp_auth_type = 'PASS', - $ha_vrrp_auth_password = undef, - $ha_vrrp_advert_int = '3', - $agent_mode = 'legacy', + $package_ensure = 'present', + $enabled = true, + $manage_service = true, + $debug = false, + $external_network_bridge = 'br-ex', + $use_namespaces = true, + $interface_driver = 'neutron.agent.linux.interface.OVSInterfaceDriver', + $router_id = undef, + $gateway_external_network_id = undef, + $handle_internal_only_routers = true, + $metadata_port = '9697', + $send_arp_for_ha = '3', + $periodic_interval = '40', + $periodic_fuzzy_delay = '5', + $enable_metadata_proxy = true, + $network_device_mtu = undef, + $router_delete_namespaces = false, + $ha_enabled = false, + $ha_vrrp_auth_type = 'PASS', + $ha_vrrp_auth_password = undef, + $ha_vrrp_advert_int = '3', + $agent_mode = 'legacy', + $allow_automatic_l3agent_failover = false, ) { include neutron::params @@ -138,20 +146,21 @@ } neutron_l3_agent_config { - 'DEFAULT/debug': value => $debug; - 'DEFAULT/external_network_bridge': value => $external_network_bridge; - 'DEFAULT/use_namespaces': value => $use_namespaces; - 'DEFAULT/interface_driver': value => $interface_driver; - 'DEFAULT/router_id': value => $router_id; - 'DEFAULT/gateway_external_network_id': value => $gateway_external_network_id; - 'DEFAULT/handle_internal_only_routers': value => $handle_internal_only_routers; - 'DEFAULT/metadata_port': value => $metadata_port; - 'DEFAULT/send_arp_for_ha': value => $send_arp_for_ha; - 'DEFAULT/periodic_interval': value => $periodic_interval; - 'DEFAULT/periodic_fuzzy_delay': value => $periodic_fuzzy_delay; - 'DEFAULT/enable_metadata_proxy': value => $enable_metadata_proxy; - 'DEFAULT/router_delete_namespaces': value => $router_delete_namespaces; - 'DEFAULT/agent_mode': value => $agent_mode; + 'DEFAULT/debug': value => $debug; + 'DEFAULT/external_network_bridge': value => $external_network_bridge; + 'DEFAULT/use_namespaces': value => $use_namespaces; + 'DEFAULT/interface_driver': value => $interface_driver; + 'DEFAULT/router_id': value => $router_id; + 'DEFAULT/gateway_external_network_id': value => $gateway_external_network_id; + 'DEFAULT/handle_internal_only_routers': value => $handle_internal_only_routers; + 'DEFAULT/metadata_port': value => $metadata_port; + 'DEFAULT/send_arp_for_ha': value => $send_arp_for_ha; + 'DEFAULT/periodic_interval': value => $periodic_interval; + 'DEFAULT/periodic_fuzzy_delay': value => $periodic_fuzzy_delay; + '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 { diff --git a/spec/classes/neutron_agents_l3_spec.rb b/spec/classes/neutron_agents_l3_spec.rb index a7301fd7b..eb0a99040 100644 --- a/spec/classes/neutron_agents_l3_spec.rb +++ b/spec/classes/neutron_agents_l3_spec.rb @@ -7,27 +7,28 @@ end let :default_params do - { :package_ensure => 'present', - :enabled => true, - :debug => false, - :external_network_bridge => 'br-ex', - :use_namespaces => true, - :interface_driver => 'neutron.agent.linux.interface.OVSInterfaceDriver', - :router_id => nil, - :gateway_external_network_id => nil, - :handle_internal_only_routers => true, - :metadata_port => '9697', - :send_arp_for_ha => '3', - :periodic_interval => '40', - :periodic_fuzzy_delay => '5', - :enable_metadata_proxy => true, - :network_device_mtu => nil, - :router_delete_namespaces => false, - :ha_enabled => false, - :ha_vrrp_auth_type => 'PASS', - :ha_vrrp_auth_password => nil, - :ha_vrrp_advert_int => '3', - :agent_mode => 'legacy' } + { :package_ensure => 'present', + :enabled => true, + :debug => false, + :external_network_bridge => 'br-ex', + :use_namespaces => true, + :interface_driver => 'neutron.agent.linux.interface.OVSInterfaceDriver', + :router_id => nil, + :gateway_external_network_id => nil, + :handle_internal_only_routers => true, + :metadata_port => '9697', + :send_arp_for_ha => '3', + :periodic_interval => '40', + :periodic_fuzzy_delay => '5', + :enable_metadata_proxy => true, + :network_device_mtu => nil, + :router_delete_namespaces => false, + :ha_enabled => false, + :ha_vrrp_auth_type => 'PASS', + :ha_vrrp_auth_password => nil, + :ha_vrrp_advert_int => '3', + :agent_mode => 'legacy', + :allow_automatic_l3agent_failover => false } end let :params do @@ -56,6 +57,7 @@ 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