Installing Neutron LBaaS

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.

Getting ready

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

How to do it...

To enable the Neutron LBaaS feature, first carry out the following steps on the network node:

  1. We install the LBaaS agent using apt:
    sudo apt-get update
    sudo add-apt-repository ppa:openstack-ubuntu-testing/kilo
    neutron-lbaas-agent haproxy
    
  2. We enable the Load Balance service in the [Default] section of the /etc/neutron/neutron.conf file by adding lbaas to the service_plugins line as follows:
    service_plugins = lbaas

    Tip

    The service_plugins line is a comma-delimited list, for example:

    service_plugins = lbaas,router
  3. We enable the HA Proxy Load Balancer service by adding the following lines to /etc/neutron/neutron.conf:
    [service_providers]
    service_provider = LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
  4. We then edit the /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
  5. On the network node, we start the Neutron LBaaS agent:
    sudo start neutron-lbaas-agent
    
  6. On the 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

    Tip

    The service_plugins line is a comma-delimited list, for example:

    service_plugins = lbaas,router
  7. We then enable the HA Proxy Load Balance service by adding the following lines to the /etc/neutron/neutron.conf configuration file:
    [service_providers]
    service_provider = LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
  8. On the controller node, we restart the Neutron API service:
    sudo restart neutron-server
    
  9. Horizon, the OpenStack Dashboard, can also be configured for use with Neutron's LBaaS. To enable this feature, edit the /etc/openstack-dashboard/local_settings.py file to insert the following lines:
    OPENSTACK_NEUTRON_NETWORK = {
        'enable_lb': True,
        ...
    }
  10. Restart Apache to pick up the changes:
    service apache2 restart
    

How it works...

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset