Support: 1-800-961-4454
Sales Chat
1-800-961-2888

Inside My 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 that I want to look at is adding the OpenStack Networking LBaaS (Load Balancer) to my Rackspace Private Cloud. This is currently a Tech Preview and unsupported feature of Rackspace Private Cloud v4.2 and is 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

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

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

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

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

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

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

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

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

neutron lb-pool-show mypool

Horizon

In Horizon this looks like the following:

For more information on OpenStack Networking LBaaS visit here.

To find out how we got here, check out the previous posts in this series.

About the Author

This is a post written and contributed by Kevin Jackson.

Kevin Jackson, the author of OpenStack Cloud Computing Cookbook, is part of the Rackspace Private Cloud Team and focuses on assisting enterprises to deploy and manage their Private Cloud infrastructure. Kevin also spends his time conducting research and development with OpenStack, blogging and writing technical white papers.


More

Leave a New Comment

(Required)


Racker Powered
©2014 Rackspace, US Inc.