From 275aeccc50af8ffbebd7fe9c84d502dc0f2a3ccd Mon Sep 17 00:00:00 2001 From: Akash V Gunjal Date: Fri, 6 Mar 2015 21:55:33 +0530 Subject: [PATCH] Add custom interface_driver to lbaas_agent.ini template with the help of a new attribute A new attribute will be added which can used to set the custom interface_driver in case if the plugin is neither ovs nor linuxbridge. An additional attribute is added to set the ovs_use_veth value present in case of ovs plugin to 'True' or 'False'. Change-Id: Iba95c216ca46b9ed0927758b9645525ca7d5e3c9 Closes-Bug: #1429189 --- README.md | 5 +++++ attributes/default.rb | 9 +++++++++ spec/balancer_spec.rb | 5 ++++- .../default/services/neutron-lbaas/lbaas_agent.ini.erb | 6 +++--- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6336c733..ddf29377 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,11 @@ VPN Agent Configuration * `openstack['openstack']['network']['vpn']['vpn_device_driver'] - (ListOpt) Comma-separated list of VPN device drivers which VPN agent will use * `openstack['openstack']['network']['vpn']['ipsec_status_check_interval'] - (IntOpt) Status check interval for ipsec VPN +LBaaS Agent Configuration +---------------------- +* `openstack['openstack']['network']['lbaas']['custom_interface_driver']` - Custom plugin to support new interface drivers +* `openstack['openstack']['network']['lbaas']['ovs_use_veth']` - (BoolOpt) Used to enable veth pairs for OVS based plugins + The following attributes are defined in attributes/default.rb of the common cookbook, but are documented here due to their relevance: * `openstack['endpoints']['network-api-bind']['host']` - The IP address to bind the api service to diff --git a/attributes/default.rb b/attributes/default.rb index 84bf0647..5cbd615f 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -420,8 +420,17 @@ default['openstack']['network']['lbaas']['periodic_interval'] = 10 # Set lbaas plugin # Supported types are: 'ovs' (ovs based plugins(OVS, Ryu, NEC, NVP, BigSwitch/Floodlight)) # and 'linuxbridge'. +# The lbaas plugin type can also be used for other drivers using +# node['openstack']['network']['lbaas']['custom_interface_driver'] attribute. +# Set this attribute to 'other' in order to load a custom driver default['openstack']['network']['lbaas_plugin'] = 'ovs' +# Custom plugin to support new interface drivers. +default['openstack']['network']['lbaas']['custom_interface_driver'] = nil + +# Using veth pairs for OVS based plugins. +default['openstack']['network']['lbaas']['ovs_use_veth'] = 'False' + # ============================= OVS Plugin Configuration =================== # Type of network to allocate for tenant networks. The default value 'local' is diff --git a/spec/balancer_spec.rb b/spec/balancer_spec.rb index 66daf069..03edc68f 100644 --- a/spec/balancer_spec.rb +++ b/spec/balancer_spec.rb @@ -67,7 +67,9 @@ describe 'openstack-network::balancer' do it 'displays the interface driver setting for ovs lbaas plugin' do node.set['openstack']['network']['lbaas_plugin'] = 'ovs' + node.set['openstack']['network']['lbaas']['ovs_use_veth'] = 'True' expect(chef_run).to render_file(file.name).with_content(/^interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver$/) + expect(chef_run).to render_file(file.name).with_content(/^ovs_use_veth = True$/) end it 'displays the interface driver setting for linuxbridge lbaas plugin' do @@ -77,7 +79,8 @@ describe 'openstack-network::balancer' do it 'displays a null interface driver setting for other lbaas plugins' do node.set['openstack']['network']['lbaas_plugin'] = 'another_lbaas-plugin' - expect(chef_run).to render_file(file.name).with_content(/^interface_driver =$/) + node.set['openstack']['network']['lbaas']['custom_interface_driver'] = 'custom_driver' + expect(chef_run).to render_file(file.name).with_content(/^interface_driver = custom_driver$/) end it 'displays user_group as nogroup' do diff --git a/templates/default/services/neutron-lbaas/lbaas_agent.ini.erb b/templates/default/services/neutron-lbaas/lbaas_agent.ini.erb index c51149b5..85a478f6 100644 --- a/templates/default/services/neutron-lbaas/lbaas_agent.ini.erb +++ b/templates/default/services/neutron-lbaas/lbaas_agent.ini.erb @@ -18,14 +18,14 @@ interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver # Use veth for an OVS interface or not. # Support kernels with limited namespace support # (e.g. RHEL 6.5) so long as ovs_use_veth is set to True. -#ovs_use_veth = True +ovs_use_veth = <%= node['openstack']['network']['lbaas']['ovs_use_veth'] %> <% when "linuxbridge" %> # LinuxBridge interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver <% else %> # LBaaS currently supports openvswitch and linuxbridge drivers only. -# Please use one of them. -interface_driver = +# Custom driver can be set here if not using openvswitch or linuxbridge. +interface_driver = <%= node['openstack']['network']['lbaas']['custom_interface_driver'] %> <% end %> # The agent requires drivers to manage the loadbalancer. HAProxy is the opensource version.