Allow customize l3 agent HA parameters

Parameterize l3_ha, max_l3_agents_per_router,
ha_vrrp_advert_int setting, so that user can deploy
 a topology with neutron l3 agent HA enabled.

Change-Id: Iab159efcc30349e6481c944a5afb16293fbb0826
Closes-Bug: #1417913
This commit is contained in:
Hong Hui Xiao
2015-02-04 17:57:32 +08:00
parent 3dc753cfbe
commit e4766fb2b6
7 changed files with 56 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ This file is used to list changes made in each version of cookbook-openstack-net
* Add radvd to neutron_l3_packages to support ipv6
* Use common specific_endpoint routines (bug 1412919)
* Parameterize dhcp_agents_per_network
* Parameterize neutron l3 agent HA parameters
## 10.1.0
* Add support for Neutron VPN Service

View File

@@ -138,7 +138,10 @@ DHCP Agent Configuration
L3 Agent Configuration
----------------------
* `openstack['openstack']['network']['l3']['router_delete_namespaces'] - (StrOpt) If True, namespaces will be deleted when a router is destroyed.
* `openstack['openstack']['network']['l3']['router_delete_namespaces']` - (StrOpt) If True, namespaces will be deleted when a router is destroyed.
* `openstack['openstack']['network']['l3']['ha']['l3_ha']` - (BoolOpt) If True, virtual router will be created as ha by default. (default False)
* `openstack['openstack']['network']['l3']['ha']['max_l3_agents_per_router']` - (IntOpt) The maximum number of l3 agents for each ha router. (default 3)
* `openstack['openstack']['network']['l3']['ha']['ha_vrrp_advert_int']` - (IntOpt) The advertisement interval in seconds. (default 2)
VPN Agent Configuration
----------------------

View File

@@ -375,6 +375,15 @@ default['openstack']['network']['l3']['periodic_fuzzy_delay'] = 5
# If True, namespaces will be deleted when a router is destroyed
default['openstack']['network']['l3']['router_delete_namespaces'] = 'False'
# Set the default value of ha parameter for virtual router.
default['openstack']['network']['l3']['ha']['l3_ha'] = 'False'
# Set the default maximum number of l3 agents for each ha router.
default['openstack']['network']['l3']['ha']['max_l3_agents_per_router'] = 3
# Set the default advertisement interval in seconds
default['openstack']['network']['l3']['ha']['ha_vrrp_advert_int'] = 2
# ============================= VPN Agent Configuration ====================
# VPN device drivers which vpn agent will use

View File

@@ -555,6 +555,13 @@ describe 'openstack-network' do
expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^dhcp_agents_per_network = dhcp_agents_per_network_value$/)
end
%w(l3_ha max_l3_agents_per_router).each do |attr|
it "sets the #{attr} attribute" do
node.set['openstack']['network']['l3']['ha'][attr] = "#{attr}_value"
expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^#{attr} = #{attr}_value$/)
end
end
%w(notify_nova_on_port_status_changes notify_nova_on_port_data_changes send_events_interval).each do |attr|
it "sets the #{attr} nova attribute" do
node.set['openstack']['network']['nova'][attr] = "#{attr}_value"

View File

@@ -83,6 +83,11 @@ describe 'openstack-network::l3_agent' do
end
end
it 'sets the ha_vrrp_advert_int attribute' do
node.set['openstack']['network']['l3']['ha']['ha_vrrp_advert_int'] = 'ha_vrrp_advert_int_value'
expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^ha_vrrp_advert_int = ha_vrrp_advert_int_value$/)
end
%w[router_id gateway_external_network_id].each do |conditional_attr|
it "displays the #{conditional_attr} attribute when present" do
node.set['openstack']['network']['l3'][conditional_attr] = "network_l3_#{conditional_attr}_value"

View File

@@ -91,3 +91,16 @@ router_delete_namespaces = <%= node['openstack']['network']['l3']['router_delete
# DVR. This mode must be used for an L3 agent running on a centralized
# node (or in single-host deployments, e.g. devstack).
# agent_mode = legacy
# Location to store keepalived and all HA configurations
# ha_confs_path = $state_path/ha_confs
# VRRP authentication type AH/PASS
# ha_vrrp_auth_type = PASS
# VRRP authentication password
# ha_vrrp_auth_password =
# The advertisement interval in seconds
ha_vrrp_advert_int = <%= node['openstack']['network']['l3']['ha']['ha_vrrp_advert_int'] %>

View File

@@ -283,6 +283,23 @@ dhcp_agents_per_network = <%= node['openstack']['network']['dhcp']['dhcp_agents_
# =========== end of items for agent scheduler extension =====
# =========== items for l3 extension ==============
# Enable high availability for virtual routers.
l3_ha = <%= node['openstack']['network']['l3']['ha']['l3_ha'] %>
# Maximum number of l3 agents which a HA router will be scheduled on. If it
# is set to 0 the router will be scheduled on every agent.
max_l3_agents_per_router = <%= node['openstack']['network']['l3']['ha']['max_l3_agents_per_router'] %>
# Minimum number of l3 agents which a HA router will be scheduled on. The
# default value is 2.
# min_l3_agents_per_router = 2
# CIDR of the administrative network if HA mode is enabled
# l3_ha_net_cidr = 169.254.192.0/18
# =========== end of items for l3 extension =======
# =========== WSGI parameters related to the API server ==============
# Number of separate worker processes to spawn. The default, 0, runs the
# worker thread in the current process. Greater than 0 launches that number of