OpenStack is one of the fastest growing open source projects being worked on today. As a cloud IaaS solution it has many aspects and moving parts, which can make even getting a demo version installed a difficult task. Today we are going to stand up a complete OpenStack cloud on top of the CenturyLink Cloud and allow you to play with the Web UI, the exposed services API's, and whatever depth you would like to go into looking at the inner workings of the system.
Lucky for us there is a shortcut to standing the demo version up... We will be using the single VM install that the actual contributors to the project use to develop new code and patches. This project is called "DevStack" and it allows us to deploy and run the base OpenStack components within a single CenturyLink Cloud virtual machine. It is important to realize that in order to run OpenStack Compute (Nova) effectively we need to give it resources... Nova is a cloud controller that will allow us to create and run multiple VM's so our CenturyLink Cloud Server needs to be pretty large. I have created a server with 4 CPU's, 48 GB of RAM, and the default amount of storage, as seen here:
The base OS is Ubuntu 12.04 64 bit. A key advantage of installing this base OpenStack image is that we can snapshot it and re-use it as we move to add more services, multiple servers, etc. After creating the server and adding a public IP you should create the non-root user that will be the primary demo user. You might think that just running as root would be simpler, but DevStack is smart enough to detect that you are trying to run in this "dangerous" manner and refuse to start!
Create New User
It is generally not a good idea to run as root, so in order to update our Ubuntu system and install DevStack we will first set up a new user. After giving the new user the appropriate permissions we will logout of root and login as our newly created user. Open your terminal/SSH program and login to your server. Since we are logging in as root the command will be 'ssh root@Public IP'. From the above screen shot you can see my public IP is 126.96.36.199 and so my command will be 'ssh firstname.lastname@example.org'. The root password is the server admin password you set while creating the server. Create a new user by following these steps:
$ adduser _stack_
At the prompt create a password (use 'stack' for convenience) for this user and then accept the default user information by pressing ENTER at the prompts. In order to give stack the correct privileges we must add the user to the sudoers file.
# Edit the sudoers file to add the new user $ visudo
Add new user in the ‘User privilege specification’ section.
# User privilege specification root ALL=(ALL:ALL) ALL <em>stack</em> ALL=(ALL:ALL) ALL
Once the file has been successfully edited press CTRL-x to exit the file; and Y to save the changes. Logout as the root user and then login as stack. We now have a normal user with sufficient privileges to install OpenStack.
We now need to install 'git':
$ sudo apt-get update $ sudo apt-get install git
DevStack is a shell script that is intended to offer a single system, running OpenStack cloud. Primarily developed and maintained so that folks can develop new code and patches for the open source project it is also a great way to install a OpenStack demonstration system. The DevStack script will install everything needed to run a full OpenStack Cloud, no need to piece-meal anything else. Since the script points to the latest builds there is another advantage that you will get the latest bits by default. Look here for more details on DevStack.
First clone the DevStack code repo:
$ git clone https://github.com/openstack-dev/devstack.git
And, run the DevStack install script:
$ cd devstack $ ./stack.sh
This is an extensive install script (as you can imagine) and you will see a bunch of stuff scrolling by on the screen. Eventually you will get prompted to enter passwords for the default services that are being installed. It is OK to let the system generate these as you will not be interacting with the services directly at this point.
However, when it asks for the Horizon/Keystone password enter 'stack', as this will be your login to the OpenStack Dashboard. The Horizon Dashboard is located at the public IP for your CenturyLink Cloud Server. Point your browser to this IP (in my case this is http://188.8.131.52) and you will be prompted to login to your newly installed and running OpenStack Cloud. Use 'admin' as the user and 'stack' as the password and you are now able to fully administer and play with your OpenStack Cloud!
Be sure to take a snapshot of this server as we will use this in future tutorials to expand the services mix and show you various things you can do with your new OpenStack Cloud. For more information on OpenStack look here.