Home Rackspace Private Cloud / OpenStack Lab: Part 7 LBaaS

With a useful OpenStack lab up and running, it’s time to take advantage of some more advanced features. The first of which I want to look at is adding the OpenStack Networking LBaaS (Load Balance) to my Rackspace Private Cloud. This is currently a Tech Preview and unsupported feature of Rackspace Private Cloud v4.2 and not considered for use in production at this time. To add this to RPC we simply make a change to the environment and run chef-client across the nodes.

More information on LBaaS and Rackspace Private Cloud can be found here

Adding LBaaS to Rackspace Private Cloud Lab

1. Edit /opt/base.env.json (or the name of the JSON describing your environment) and add in the following:

 "neutron": {
  "ovs": {
    ...
  },
  "lbaas": {
    "enabled": true
  }
},
...

"horizon": {
  "neutron": {
    "enable_lb": "True"
  }
},

2. Save and then load this into the environment

knife environment from file /opt/base.env.json

3. Now run chef-client on the controllers

# openstack1
chef-client

# openstack2
knife ssh "role:ha-controller2" chef-client

That’s it, LBaaS is now enabled in our RPC Lab!

Creating a Load Balancer

The first thing we do is to create a load balance pool.

1. To do this get the UUID of the private subnet we want our load balancer to live on.

neutron subnet-list

subnet-list

2. Next we create a pool:

neutron lb-pool-create 
    --lb-method ROUND_ROBIN 
    --name mypool 
    --protocol HTTP 
    --subnet-id 19ab172a-87af-4e0f-82e8-3d275c9430ca

lb-pool-create

3. We can now add members to this pool. For this I’m using two instances spun up running Apache running on

nova list

nova-list

neutron lb-member-create --address 192.168.1.152 --protocol-port 80 mypool
neutron lb-member-create --address 192.168.1.153 --protocol-port 80 mypool

lb-member-create

4. We can now create a Healthmonitor and associated it with the pool. This tests the members availability and controls whether to send traffic to that member or not:

neutron lb-healthmonitor-create --delay 3 --type HTTP --max-retries 3 --timeout 3
lb-healthmonitor-create

neutron lb-healthmonitor-associate 5479a729-ab81-4665-bfb8-992aab8d4aaf mypool
lb-associate-health

5. With that in place, we now create the load balanced VIP using the subnet UUID and the name of the load balancer (myPool). The VIP is the address of the load balanced pool.

neutron lb-vip-create 
    --name myvip 
    --protocol-port 80 
    --protocol HTTP 
    --subnet-id 19ab172a-87af-4e0f-82e8-3d275c9430ca mypool
lb-vip-create

This has taken an IP from the subnet that we created the load balance pool on of 192.168.1.154 and we can now use this to access our load balanced web pool consisting of the two Apache instances – for example: http://192.168.1.154/

Viewing details about the load balancers

To list the load balancer pools issue the following:

neutron lb-pool-list

lb-pool-list

To see information and list the members in a pool issue the following:

neutron lb-pool-show mypool

lb-pool-show

Horizon

In Horizon this looks like the following

horizon-lb-pools

horizon-lb-members

horizon-lb-monitors

For more information on OpenStack Networking LBaaS visit here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: