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:
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
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.
2. Next we create a pool:
3. We can now add members to this pool. For this I’m using two instances spun up running Apache running on
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.
--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:
To see information and list the members in a pool issue the following:
neutron lb-pool-show mypool
In Horizon this looks like the following
For more information on OpenStack Networking LBaaS visit here.