A couple of weeks ago, I had the opportunity to talk about OpenStack and High Availability (HA) on the vBrownBag podcast. The slide deck below (since updated) is based on the presentation I gave, during which we discussed OpenStack HA at the various layers of a Cloud platform, from the application down to the Cloud infrastructure layers. Unfortunately, I did not have time to demonstrate how to set up a test or proof of concept OpenStack environment during the podcast; so this post will walk through the steps necessary to build such an environment on a laptop or PC, using Vagrant with VMware Workstation, VMware Fusion, or VirtualBox.
Before moving on, I need to give credit to three of my colleagues on the Rackspace Private Cloud team, Cloud Architects extraordinaire – Jacob Walcik, James Thorne, and Rags Srinivas. Both the slide deck below and the contents of this post are derived from work they’ve already performed and published. James posted on his personal blog, details on how to create a single controller node and single compute node Rackspace Private Cloud environment, using Opscode Chef with Vagrant; the Rackspace Private Cloud is a product that is based on the downstream OpenStack trunk. While Jacob and Rags will be leading a session, at the OpenStack Summit, on OpenStack HA, which I encourage everyone to attend; more details on OpenStack HA can also be found on a Rackspace blog post, written by Rags. I’ve simply modified the great work that James, Jacob, and Rags had done in order to create a mulit-node HA OpenStack environment.
What Does HA Mean In OpenStack?
Setting Up Your Lab
So what are we building on your laptop or PC to test OpenStack HA? The sample Rackspace Private Cloud reference architecture below shows the 4 node environment we will be creating, with 2 controller nodes and 2 compute nodes. The difference here is that we will be deploying Chef on a separate server and we will not initially break out the 2 compute nodes into different availability zones. To provide HA for the Cloud Controllers, we will be using a combination of HAProxy and Keepalived, both of which are discussed in the slide deck above.
Since James did such a great job of detailing all the commands for setting up OpenStack with Chef using Vagrant, I won’t repeat them; instead I encourage you to look at his post and I’ll detail where the steps may differ to create a HA OpenStack environment.
Configuring Your VMs With Vagrant
- The first step is to install Vagrant and here I encourage you to install the latest version, which is currently 1.3.4.
- Then install whichever virtualization software you intend to use as your Vagrant provider, including any Vagrant plugin that is required.
- Download and add the Vagrant box appropriate for the virtualization software you have chosen. In all cases, we will be using a version of the precise64 Vagrant box to install Ubuntu 12.04 LTS on all our nodes.
- Create a directory for this lab project and create the initial Vagrantfile.
- Edit the created Vagrantfile and replace the contents with the following entries (Note that you can scroll down the text box to see the entire Vagrantfile):
You can also access the Vagrantfile here.
Configuring Chef to Install OpenStack
- Start up all your nodes using Vagrant.
- Install Chef Server on your Chef node.
- Install Chef Client on all your OpenStack nodes.
- Create a Chef Environment file for Rackspace Private Cloud.
- Edit the created Environment file and replace the contents with the following entries (Note that you can scroll down the text box to see the entire Environment file):
You can also access the Environment file here.
Note that VIPs will be created for API services, MySQL, and RabbitMQ.
- Set the Chef default Environment to the Environment you just created.
- Assign the appropriate OpenStack roles to each Chef node.
- Install OpenStack by converging all chef nodes with their assigned roles.
- If you wish, follow James’ instructions to further configure OpenStack.
- Start up a browser and connect through the Horizon VIP to begin managing OpenStack and to spin up instances.
Testing OpenStack Controller HA
- View all IP Addresses assigned to controller1 by typing “ip addr” and note the assigned VIPs.
- View all IP Addresses assigned to controller2 by typing “ip addr” and note the absence of assigned VIPs.
- Now stop controller1 by using “vagrant suspend controller1” or “vagrant halt controller1”
- View all IP Addresses assigned to controller2 by typing “ip addr” and note that VIPs are now running on controller2.
- Start up a browser and connect through the Horizon VIP again.
You now have an environment to play with OpenStack and to conduct further testing, including evacuating instances from one compute node to another. As I have opportunity to run through a suite of tests myself, I will try to publish the test scripts and results in a future blog post.
- Installing OpenStack Grizzly in 10 Minutes (developer.rackspace.com)
- Setup your project with cloudenvy and OpenStack (logilab.org)