Unlike its cartoon namesake Jimmy Neutron, OpenStack Neutron has an extensible plugin mechanism that enables more network features through the Neutron API. By enabling the Load-Balancer-as-a-Service (LBaaS) agent plugin on our Network node, we are able to create and manage Load Balancers through Neutron API calls. There are drivers for many hardware vendors; the following example uses the HA Proxy reference driver for Open vSwitch.
To install Neutron LBaaS, we install the LBaaS agent on the network
node and configure Neutron on both the network
and controller
nodes to pick up the service.
Ensure that you have a suitable server running the OpenStack network components. If you are using the accompanying Vagrant environment, as described in the Preface, we will use the same network
node for this recipe.
Ensure that you are logged into the network
node as well as the controller
node in our environment. If you created these nodes with Vagrant, you can execute the following command:
vagrant ssh network vagrant ssh controller
To enable the Neutron LBaaS feature, first carry out the following steps on the network
node:
apt
:sudo apt-get update sudo add-apt-repository ppa:openstack-ubuntu-testing/kilo neutron-lbaas-agent haproxy
[Default]
section of the /etc/neutron/neutron.conf
file by adding lbaas
to the service_plugins
line as follows:service_plugins = lbaas
/etc/neutron/neutron.conf
:[service_providers] service_provider = LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
/etc/neutron/lbaas_agent.ini
file to have the following lines:[DEFAULT] debug = False interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver device_driver = neutron.services.loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver [haproxy] loadbalancer_state_path = $state_path/lbaas user_group = nogroup
network
node, we start the Neutron LBaaS agent:sudo start neutron-lbaas-agent
controller
node, where our Neutron API is running, we edit the /etc/neutron/neutron.conf
file to match the same configuration presented previously. Under the [Default]
section, we enable the Load Balance service by adding lbaas
to the service_plugins
line:service_plugins = lbaas
/etc/neutron/neutron.conf
configuration file:[service_providers] service_provider = LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
controller
node, we restart the Neutron API service:sudo restart neutron-server
etc/openstack-dashboard/local_settings.py
file to insert the following lines:OPENSTACK_NEUTRON_NETWORK = { 'enable_lb': True, ... }
service apache2 restart
We have enabled the Neutron LBaaS plugin in our environment by first installing the Neutron LBaaS agent package on our network
node, and then configuring this for use with HA Proxy. The /etc/neutron/neutron.conf
file notifies our neutron
services of this feature with the following lines:
[Default] service_plugins = lbaas [Service_Providers] service_provider = LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
The specific configuration of the LBaaS Agent is achieved in the /etc/neutron/lbaas-agent.ini
file on the node running the agent, which is our network
node.
We then notify the Neutron API service running on the controller
about the Neutron LBaaS plugin. We copy the same neutron.conf
settings file created here onto the controller
node and restart the Neutron Server API service.