Installing Devstack

One of the first thibgs you need to do once you decide its time to learn openstack is to install devstack on your system so that you can begin to play around with it.

There are a few options to get devstack running. One is installing it on virtualbox and the other is installing it on a a laptop or any other spare pc you may have lying around.

Bare in mind that it is quite resource hungry and that you will need to give it at least 4gb of RAM.I will walk you through the ways you can install it.

Easy way - Using Vagrant

The quickest way to install devstack is through vegrant . I have found that the following box is quite popular, and it does work, however some of the features like neutron arent installed
vagrant init monasca/devstack; 
vagrant up --provider virtualbox
 

Using bare metal

Minimal Install
You need to have a system with a fresh install of Linux. You can download the Minimal CD for Ubuntu releases since DevStack will download & install all the additional dependencies. The netinstall ISO is available for Fedora and CentOS/RHEL. You may be tempted to use a desktop distro on a laptop, it will probably work but you may need to tell Network Manager to keep its fingers off the interface(s) that OpenStack uses for bridging.

The following guide will also install neutron on Devstack a service that isnt available on the vagrant box and is hard to configure on virtualbox.

Also use Ubuntu 14.04 and not 16.04 , as of writing this article , the script hasn't been modified for it yet.

Network Configuration
Determine the network configuration on the interface used to integrate your OpenStack cloud with your existing network. For example, if the IPs given out on your network by DHCP are 192.168.1.X - where X is between 100 and 200 you will be able to use IPs 201-254 for floating ips.

To make things easier later change your host to use a static IP instead of DHCP (i.e. 192.168.1.201).

Installation shake and bake
Add your user
We need to add a user to install DevStack. (if you created a user during install you can skip this step and just give the user sudo privileges below)
adduser stack
Since this user will be making many changes to your system, it will need to have sudo privileges:
apt-get install sudo -y || yum install -y sudo
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
From here on you should use the user you created. Logout and login as that user.
Download DevStack
We’ll grab the latest version of DevStack via https:
sudo apt-get install git -y || sudo yum install -y git
git clone https://git.openstack.org/openstack-dev/devstack
cd devstack
Run DevStack
Now to configure stack.sh. DevStack includes a sample in devstack/samples/local.conf. Create local.conf as shown below to do the following:
  • Set FLOATING_RANGE to a range not used on the local network, i.e. 192.168.0.224/27. This configures IP addresses ending in 225-254 to be used as floating IPs.
  • Set FIXED_RANGE and FIXED_NETWORK_SIZE to configure the internal address space used by the instances.
  • Set FLAT_INTERFACE to the Ethernet interface that connects the host to your local network. This is the interface that should be configured with the static IP address mentioned above.
  • Set the administrative password. This password is used for the admin and demo accounts set up as OpenStack users.
  • Set the MySQL administrative password. The default here is a random hex string which is inconvenient if you need to look at the database directly for anything.
  • Set the RabbitMQ password.
  • Set the service password. This is used by the OpenStack services (Nova, Glance, etc) to authenticate with Keystone.
local.conf should look something like this:
[[local|localrc]]
FLOATING_RANGE=192.168.0.224/27
FIXED_RANGE=10.0.0.0/24
FIXED_NETWORK_SIZE=256
FLAT_INTERFACE=eth0
ADMIN_PASSWORD=password
DATABASE_PASSWORD=iheartdatabases
RABBIT_PASSWORD=flopsymopsy
SERVICE_PASSWORD=iheartksl

disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta

Optional, to enable tempest configuration as part of devstack

enable_service tempest

enable_service neutron

enable_service q-meterin

Neutron - Load Balancing

ENABLED_SERVICES+=,q-lbaas

Heat - Orchestration Service

ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
HEAT_STANDALONE=True

Ceilometer - Metering Service (metering + alarming)

ENABLED_SERVICES+=,ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api
ENABLED_SERVICES+=,ceilometer-alarm-notify,ceilometer-alarm-eval

Run DevStack:
./stack.sh
A seemingly endless stream of activity ensues. When complete you will see a summary of stack.sh‘s work, including the relevant URLs, accounts and passwords to poke at your shiny new OpenStack.