Building an OpenStack home lab – Installing OpenStack

If you’ve made it this far, hopefully you’ve already completed steps similar to those outlined in my previous two posts…

The Lab
Prepping the VMs

If you have, we’re now ready to start installing OpenStack itself.  To do this, I’ve built a set of installation scripts.  All of the files are out on Github…

https://github.com/jonlangemak/openstackbuild

I suggest you pull them from there into a local directory you can work off of.  There is a folder for each VM that needs to be built and each folder has a file called ‘install’.  This file contains all of the steps required to build each on one of the three nodes.  The remaining files are all of the configuration files that need to change in order for OpenStack to work in our build.  We’ll be copying these files over to the VMs as part of the install.

A couple of notes before we start…

-The beginning of each each install file lists all of the packages that need to be installed for this to work.  I suggest you start the package install on each VM at the same time as it can take some time to complete.

The controller install has an additional step before the package install which disables a service from running.  Ubuntu’s package manager automatically starts services as part of the installation.  This is different than how it’s handled on RHEL based systems.

-The config and configuration files assume that you used the same IPs, VLANs, or hostnames.  While most of the configuration relies on DNS, there are some hard coded static IPs.  If you are not using the same layout, you can search the config files for flags that looks like ‘**CHANGE THIS IF NEEDED**’.  Lines following that flag are specific to this configuration and will need to be changed if you used different IPs, VLANs, or hostnames.  Im 99% sure I flagged all of the areas but if I missed something let me know.

-The configuration relies on the upstream network being configure to support all of the defined networks and VLANs as described in earlier posts.  Later posts will rely on these subnets having reachability to the internet as well. 

You can take two approaches to install OpenStack using these files…

Completely Manual
As mentioned, each folder has an ‘install’ file that walks you through the build process.  It tells you where to place the config files with the expectation that you’ll delete the existing config file and replace it with the one from the working directory.  This works well, but is also a little more time consuming than I had hoped.

Manual with CURL to drop config files
In each components directory I’ve placed modified ‘install’ files for each node named ‘curlinstall’.  These install files are identical to the local install files, but replace all of the config placement with curl commands to download the files from a local HTTP server.  In my case, that server is ‘http://tools’.  If you want to take this approach you can easily modify (find and replace) the curl commands to suit your needs.

Note: Yes – I know.  This is screaming for automation.  Im hoping to get this changed over to Salt or Ansible once I find time but for now the focus is getting this built so we can examine the network constructs.

Regardless of which approach you take, the installation and configuration is pretty straight forward.  Follow the install scripts from top to bottom starting with the controller and then completing the install on compute1 and compute2.  Once you’re done, go ahead and try to access the portal at this URL…

image 
You should be able to log in with any of these credentials…

Admin User – admin/openstack
Test tenant 1 – demo/demo
Test tenant 2 – demo2/demo2

Make sure that all of the credentials work as you expect and you can reach the tenant dashboards.  Next, we need to run a test to make sure that everything is working as expected.  The first thing we have to do is create an external network for the tenants to consume.  To do this, log into the dashboard as the admin user and head over to the network tab and create a new network…

Note: Just follow along for now, the next posts will walk through what we’re actually doing and all of the terminology.

image 
Here I’m creating a new network called ‘external’, saying it exists out of the interface ‘public’, is of type ‘VLAN’, and uses VLAN tag 30.  I also declare it as ‘shared’ and ‘external’.  Create the network and make sure the creation succeeds.  You’ll get a message in the upper right corner telling you either way…

image If it succeeds, go ahead and edit the network by click on the network name…

image
Click on the ‘Create Subnet’ button to define an IP subnet in the network.  If you’re using the same subnets that I am, define the subnet as shown below…

image 
image 
Again, make sure it completes successfully…

image
Now go ahead and log out of the admin user and log in as the ‘demo’ user.  Let’s again head over to the network tab and create a new network using the following settings…

image

image

image 
Make sure the creation is successful…

image Once the network is created, head over and create a new router…

image 
Name the router as you wish and then select the ‘external’ network we created under the admin tenant as the router’s external network.  Again – make sure this goes through successfully…

image 
Click the router name to edit it and add a new interface…

image 
Make sure this succeeds as well…

image
Now we can try and launch an instance so head over to the instance tab and launch an instance…

image

image 
Hit launch and watch the status of the instance to see if it launches successfully…
 image 
If the instance launches successfully, the status should change to ‘Active’…

image
Once this happens, select the action of ‘Associate Floating IP’ under the instances context menu…

image
Click the plus sign…

image
Hit ‘Allocate IP’..

image
Finally click associate to bind the floating IP to the instance.  If successful, you should see it show up under the IP address column of the instance…

image 
Now head over to the access and security tab and manage the rules in the default security group.  We’re going to add two rules…

image

image 
Once these are added, we should be able to access the instance from the external network via the floating IP address…

image

Ping works, now let’s try SSH…

Note: the default Cirros image credentials are cirros/cubswin:)

image
Nice!  So its all working.  In the next post, we’re going to talk about the basic Linux networking constructs that OpenStack uses to accomplish this.  Stay tuned!

2 thoughts on “Building an OpenStack home lab – Installing OpenStack

  1. Panic1

    I’ve just managed the same thing: only it took me a lot longer 😉 I installed everything manually to get some hands on experience, and I wanted to start with selfservice networks, which then threw me a few curve balls along the way. Now I’m at the same point as you are now.

    What are your plans with this home OpenStack installation?

    My write-up of the process can be seen here: http://www.panic1.be/tag/openstack/

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *