OpenStack Havana All-in-One lab on VMware Workstation
With all of the popularity of OpenStack in general, and specifically with my other posts on deploying the Rackspace Private Cloud lab on VMware Workstation, I think it’s time for me to update with a new lab build for everyone.
This lab build process will be done using VMware Workstation, an Ubuntu 12.04 LTS ISO file, and a few install shell scripts that I’ve created for you to pull from Github.
NOTE: This looks like a lot of work because it’s a long post, but the actual steps are quick and I’ve tried to do the heavy lifting with the install scripts, so hopefully this will only take about 20-30 minutes for you to be fully up and running.
This post will run through the use of 3 scripts that are used to set up:
- OpenStack pre-requisites – MySQL, RabbitMQ, NTP, Ubuntu Cloud Keyring, and other useful services like OpenSSH server for remote access into your VM
- OpenStack Identity (Keystone)
- OpenStack Image Service (Glance)
- OpenStack Compute (Nova)
- OpenStack Dashboard (Horizon)
There will be more posts coming after this to add additional features to illustrate the entire set of OpenStack Havana core projects, but this is your starting point to get you up on your first OpenStack Havana lab.
What is different with this install?
In my previous posts, I showed you how to use the Rackspace Private Cloud deployment as a simple recipe-oriented build that was self-installing with some input. Those builds were based on the Folsom release. This time around, I wanted to show you how to run a simple shell script with minimal input, and use the native build of OpenStack Havana so that you can test the waters on a more self-directed deployment.
The use of a shell script will give newcomers a little bit of insight in how to deploy using the command structure without using Puppet or Chef. Now, why would we do this when a more efficient way is available using those tools, right? It’s all about the learning process.
I want to bring more folks to the first steps of OpenStack deployment and management so that we can all grow our comfort with the process. Don’t worry, there will be lots of fully orchestrated posts coming, but we have to walk before we run.
Creating your Virtual Networks
This VM will require 2 networks: a public network that has internet access to pull down the installation components, and a private network that is where we launch our nested virtual guests into.
In VMware Workstation, go to your Virtual Network Editor:
Once the editor launches, you will see a variety of different networks. Your internal network will different, but I’ve built the process around a private network of 10.10.100.0/24 which in my case is VMNet13. Be sure to uncheck the Use local DHCP service to distribute IP address to VMs and be sure that your Subnet IP matches the image below:
You will need to know your IP range of the NAT network, so please write down an IP address that is on your NAT range. In the case of mine, I’ve used 192.168.79.50/24. That will be used as we launch our script once the VM is built.
Download your Ubuntu 12.04 LTS ISO file
To download your Ubuntu install image, go to http://www.ubuntu.com/download/server and choose the 12.04.03 LTS 64-bit, and keep track of where you store the ISO file once it is downloaded.
Once you have your ISO file, and your VM network information, we are ready to get started.
Building your All-in-One VM with VMware Workstation
This is a step-by-step of the process to deploy a new Ubuntu Server VM guest on VMware Workstation 10 using the Easy Install wizard. You may already be quite familiar with the process, but be sure to double-check your steps as there are some key points which could impact the build later.
This will launch the New Virtual Machine Wizard. Choose Custom (advanced) and click Next:
Take the default setting of Workstation 10.0 for your Hardware Compatibility:
Click the Browse button and locate your Ubuntu Server ISO install file then click Next:
Because we are using the Easy Install wizard, you can type in the username that you will use for your server image. Type in your full name, then your username (which is your login name), and type your password, then click Next:
For the machine name, you can choose anything but I recommend that you call it AIO-HAVANA which is what the hostname will be after the install script is run. Then click Next:
For our processor configuration, you will want to add some cores. The smallest build that I’d recommend is a 1 CPU with 2 cores. You can choose more virtual CPU or cores per processor depending on your physical hardware. Pick the appropriate sizing and click Next:
For memory, choose as much as you can spare. The minimum I will recommend is 4 GB, but if you want to do much more guest deployments and testing, more is always better. Pick the amount which suits your lab capabilities and click Next:
Choose Use network address translation (NAT) for your NIC because this is your public facing interface that we will download the OpenStack packages with. Click Next:
Take the default I/O controller (LSI Logic) and click Next:
Choose the default (SCSI) and click Next:
Choose Create a new virtual disk and click Next:
The default is 20 GB, which may work, but I recommend a minum of 40 GB. Remember that this is going to be Thin Provisioned, which means that it will only grow as the data size inside your VM guest grows.
For ease of movement and management, I always like to select Store virtual disk as a single file. Once that has been selected, click Next:
Choose the default name and click Next:
DON’T CLICK FINISH YET!! Before we do that, we have to modify our CPU configuration to set the CPU virtualization option. Click on Customize Hardware:
In the left hand pane, click Processors and then check the Virtualize Intel VT-x/EPT or AMD-V/RVI checkbox and then click Close:
Now we are good to go! Close so click Finish and the VM build will begin:
The installation will take anywhere from 5-20 minutes depending on hardware and other factors. Once you are done you will be presented with the login prompt as shown below.
Log in with the username and password that you set during the Easy Install wizard:
Now we are going to do something naughty and type sudo su – which elevates our privileges for the preparation script.
Now we will run the basic package updates and install the git and vim packages. We really only need git, but if you’re feeling like you’d like to dig around, you can edit some files using vim if you feel comfortable with that.
Type the following command:
apt-get update && apt-get install -y git vim
Once that completes, you will be back at the root@ubuntu prompt and you can clone the Git repo which contains the scripts for installing. Type the following command to download the files:
git clone https://github.com/discoposse/OpenStack-All-in-One-Havana.git
Once the files have been cloned, change directory using the following command (Remember that these are case sensitive!):
Now we will set some system variables which are used by the preparation and install scripts. The information that you need to know is the IP address that you will use, and the gateway address.
Type the following two commands using your IP info where the xx.xx.xx.xx is listed (see image below):
Once those variables are set, we will run the preparation script using this command. Note that the preparation script will set the IP network information and then shut down your VM which we need to do for the step following this:
When the preparation script completes the shutdown of your VM, edit the hardware settings and click the Add button:
Select Network Adapter as the hardware type and click Next:
For the Network Adapter Type, choose Custom: Specific virtual network and pick the network from the drop list that is our 10.10.100.0/24 segment and then click Finish:
Now that we have added our spare network adapter, power on the VM again:
You will be prompted about hardware devices that are not available. This is because we aren’t mounting the CD-ROM ISO file. There will be either one, or two prompts. Click No for each and then the machine will boot up:
Now we will see the login prompt which shows the hostname is aio-havana. Log in with the credentials you used in the first part of the build and we will start the OpenStack install script next.
Half way there!
You’ve done the first, very important steps to prepare your VM environment. Take a breather, and get ready for the next stage of the installation. Now we will log back into our VM and initialized the build script which was downloaded from the Git repository during the preparation steps.
Log on to your VM with your credentials, and we will run the following commands:
sudo su –
The install script will start, and lots of exciting OpenStack goodness will be scrolling by for the next 5-15 minutes depending on the speed of your hardware and network hosting your VM.
At some point you will see this screen prompting for what is called a “supermin appliance”. Just click into the console, use the arrow key to move the option to Yes and press Enter:
The install script will keep working away for another few minutes and will reboot when it is completed. Once that has happened, you should have a fully deployed OpenStack Havana environment to start your lab work with.
Configuring your OpenStack Havana Install
A few more steps are required to configure OpenStack to allow for your first instance to be booted. Log in with your credentials and run the following commands:
sudo su –
That script does the following:
- Create a flat DHCP network for our guest VMs (10.10.100.0/24)
- Add a firewall rule to allow telnet (TCP 22) from all source IP addresses
- Add a firewall rule to allow ping (ICMP) from all source IP addresses
When you run the script, you will see this output:
Once that is done we are ready to do the final pre-launch step which is to create an SSH keypair on our host and load it into Nova.
Creating your SSH Keypair
Generating an SSH key is quite simple. We will run the following commands to do that:
When we are prompted by the SSH keygen for questions, just press Enter to take the defaults for file name and location:
This creates a hidden directory (/root/.ssh) where it stores our file that we will now load named id_rsa.pub in the new directory. We will name it mykey just for an easy name to remember.
To import this keypair for use in OpenStack, we run the following commands:
nova keypair-add –pub_key id_rsa.pub mykey
The nova keypair-list command confirms that our key has been created and loaded into Nova. We finally have our lab ready for use.
Coming up next in a series of posts are:
- Booting your first Nova instance
- Using the Horizon Dashboard
- Adding OpenStack Block Storage (Cinder)
Stay tuned, and I hope that this will be helpful to get you on your journey to discovering OpenStack!