Lab11- Get OpenStack – DevStack Installation

POD parameters : OpenStack Group-1 user0 aio110 10.1.64.110 compute120 10.1.64.120 [email protected]
User aioX computeY Network & Allocation Pool
user0
vnc  : lab.onecloudinc.com:5900
aio110
eth0            : 10.1.64.110
eth1            : 10.1.65.110
eth2            : ext-net
Netmask  : 255.255.255.0
Gateway  : 10.1.64.1
compute120
eth0            : 10.1.64.120
eth1            : 10.1.65.120
eth2            : ext-net
Netmask  : 255.255.255.0
Float Range  : 10.1.65.0010.1.65.00
Network         : 10.1.65.0/24
Gateway         : 10.1.65.1
DNS                   : 10.1.1.92

DevStack is a tool that was initially developed to speed the deployment of OpenStack for development purposes, hence “Dev” Stack.

caution-icon*For this reason you should not use a DevStack deployment to build or run a ‘production’ OpenStack cloud.*

DevStack also allows you do build a quick example OpenStack deployment with all of the latest features, as it pulls its components from the “master” branch of each of the services. One divergence to the ‘latest features’ model is that at present, DevStack still uses the nova-network engine by default; however, we provide instructions on how to enable Neutron in this lab exercise.

One thing that is both nice and potentially confusing is the range of options available to you when building an openstack deployment. For this lab exercise, we have chosen VirtualBox as a hypervisor and Ubuntu as the operating system. This should be a good place to start, as this lab is based on Ubuntu and VirtualBox is a free hypervisor. When you get through this lab exercise, you could try some of the other ‘flavors’ of OS available.

info-icon

More of a RedHat/CentOS fan? We’ve got instructions for that DevStack process too: >>Get DevStack with CentOS<<

Step 1. Get VirtualBox

You need a base operating system on which to install DevStack, and in the spirit of the developer, this is often on a laptop. You will need a hypervisor of some nature to do this on your laptop. These next steps will step you through obtaining and instaling VirtualBox, a free hypervisor. If you already have a hypervisor installed, you can skip “using VirtualBox”, otherwise, you download the VirtualBox hypervisor and management UI from here:

https://www.virtualbox.org/wiki/Downloads

Although we suggest using your laptop, it is also an option to use a remote virtual platform (or even a remote physical machine) to deploy onto.

Step 2. Install Ubuntu

Install the latest version of Ubuntu as a base OS for the installation Devstack. Download the latest Ubuntu Trusty image (Ubuntu 14.04.1 LTS) from the Ubuntu repository. We recommended you use the desktop version, to avoid some of the peculiarities of VirtualBox networking, as you would then potentially use the embedded graphical interface for use of tools like Horizon or other web services interfaces (e.g. if you used RESTclient for Firefox to exercise the actual RESTful APIs).

http://releases.ubuntu.com/trusty/ubuntu-14.04-desktop-amd64.iso

See the end of this section for potential alternatives.

Once you have the ISO, you will want to create a new VM in VirtualBox, select Linux and Ubuntu, and provide a name like “devstack1” for your instances. You’ll want 4 GB of RAM (2 GB is the minimum you can likely get away with), and you’ll want to define a 32 GB thin provisioned disk (We suggest using qcow2 when available as it tends to be a much smaller file size than other image formats). Once complete, start the VM, and add the ISO you downloaded to the machine. Once booted, follow the instructions to install Ubuntu onto the local disk.

info-iconNote: We are providing you with all the steps to ‘build your own system. However, in some classes, you may also receive these files from the instructor via USB or similar transfer, or your instructor may provide you with an OVA bundle that you can install in most hypervisors to further accelerate the process of bringing up a DevStack environment. (OVA default user: ubuntu, default password: ubuntu)

Step 3. Start a terminal session and log in.

Once Ubuntu is installed in VirtualBox, or your OVA is imported and running, log into the user interface, and start a terminal session. Note: While we generally did run operations a sudo in our lab, you do not want to do this during this devstack process.

Step 4. Install OpenStack

sudo apt-get update
sudo apt-get install git
git clone https://github.com/openstack-dev/devstack.git
cd devstack 

 

caution-iconTwo Important Notes
1) If you prefer to run Neutron, jump to step 6 before running stack.sh
2) If you don’t want to run neutron, just follow the instructions from the devstack process

Now run:

./stack.sh

info-iconNote: If the above command returns error status as “c- api did not start,” run the following commands:

./unstack.sh              #Ignore any errors, they are not likely to be relevant.
reboot                    #reboot your VM
./stack.sh

Step 5.

Once the installation is complete, you will be provided with the IP address, username and password that can be used to access the Horizon dashboard. In the same directory where the stack.sh script was run, there is an openrc file that can be sourced (a little different than most as it allows for the potential to have more than just one user/tenant associated with the file), allowing the use of the command line client tools that are also installed:

source ./openrc admin admin # or for the demo account: source ./openrc demo demo 
nova list

Step 6. Install Neutron

It is often preferable to actually leverage the OpenStack Neutron project for the network service, and in fact in order to modify the behavior of DevStack, it is often useful to modify other services (documentation, as with many recent OSS projects is “in the script”). We’ll create a new file on the Ubuntu machine and copy in the following data {note copy in your VM}:

# Create a new file called local.conf, and copy this content into it, with vi or your favorite editor.
[[local|localrc]]
# Uncomment the next line after you've run devstack once if you don't want to try to download everything again.
#OFFLINE=true

# Set default passwords, further accelerate deployment, maybe make this less generic if you're in an environment where someone may 'play' with your system
ADMIN_PASSWORD=ubuntu
DATABASE_PASSWORD=ubuntu
RABBIT_PASSWORD=ubuntu
SERVICE_PASSWORD=ubuntu
# This is the token used to set up Keystone – It just needs to be a long random string
SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50
disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service q-metering

info-iconNote: The OFFLINE parameter reference – use this only after having run against this local.conf file, so that all of the code needed for Neutron is downloaded. Then setting it will speed up the re-start of DevStack if you want to tweak configuration parameters (We do not cover this topic in this simple tutorial).

You may find it easier to grab this file from within the VM by pointing your browser (in the VM) to the following gist:

https://gist.github.com/rstarmer/29b54c26b32387b392f2 

or

http://git.io/TQmKbQ

Step 7. Clean up

Once you’ve created your local.conf file, as defined above, run the un-stack.sh script to clean up your environment, and then run stack.sh again to build it against the new configuration. You may also want to run re-join-stack.sh in order to load the screen environment (where all of the services log files are accessible as separate screen sessions).

./unstack.sh    #Ignore any errors, they are not likely to be relevant
./stack.sh      #Should run to completion, otherwise run the previous command again
# Stop here or check step 5 again for basic access/usage instructions or run the following 
# for access to all of the log files
./rejoin-stack.sh

Screen commands: <CTRL>-a “ List all screens in a tabular format <CTRL>-a D Leave the screen session (but do not destroy the screen sessions) screen -r Rejoin the screen session if you are in the same terminal as where you just left Otherwise, use re-join-stack.sh

Step 8. Start working with your new OpenStack environment.

As with Step 5, you now have a running environment and can use either Horizon or the CLI tools to manipulate the system. Happy OpenStacking!

References

http://www.devstack.org

http://docs.openstack.org/infra/publications/devstack-tutorial/#(1) [Note this goes way beyond just DevStack]