How to setup DevStack for OpenStack development

For anyone getting started with OpenStack, the best way is to start OpenStack development is with DevStack which provides a series of extensible and customizable scripts and can be used to bring a complete OpenStack development environment from git master.
This tutorial will take you through all the steps needed for setting up DevStack on your system. It should however be noted (and this warning comes straight from DevStack’s own documentation) that DevStack makes a considerable amount of changes to the system on which it is installed. Therefore, it is generally preferred and recommended that DevStack only be installed on servers or VMs which are dedicated for this purpose.

These following steps will allow us to set up an environment of DevStack for OpenStack development:

1- In order to ensure a smooth installation process, start with a fresh Linux Server installation. While DevStack supports Ubuntu, CentOS, Fedora, Debian and OpenSUSE, Ubuntu is the most tested variant of Linux and will probably be the smoothest.

2- Update your system using following command in the terminal:
“sudo apt-get update”

3- Git must first be installed before you can clone the DevStack’s repository. Do that by typing following command:
“sudo apt-get install git-core”

4- Install ant package for Linux:
“sudo apt-get install ant”

5- Install build-essential package for Linux:
“sudo apt-get install build-essential”

6- Install pkg-config package:
“sudo apt-get install pkg-config”

7- Install linux kernel headers:
“sudo apt-get install linux-headers-3.2.0-35-virtual”

8- Clone your system with devstack git repository:
“git clone https://git.openstack.org/openstack-dev/devstack

9- Once DevStack has been cloned, change the directory by moving into the DevStack Directory:
“cd devstack/”

10- Make a file named as “local.conf” in devstack directory. Paste the following code in the file.
“Note: edit the values according to your Network settings.”

[[local|localrc]]
ADMIN_PASSWORD=<your Password>
HOST_IP=<your IP>
MYSQL_PASSWORD=<Password>
MYSQL_HOST=$HOST_IP
RABBIT_HOST=${HOST_IP}
GLANCE_HOSTPORT=${HOST_IP}:9292
RABBIT_PASSWORD=<Passowrd>
SERVICE_PASSWORD=$ADMIN_PASSWORD
RABBIT_HOST=$HOST_IP
SERVICE_HOST=$HOST_IP

# Enabled Services
enable_service q-lbaas
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service neutron

# Network
NETWORK_GATEWAY=<Network_gateway>
PUBLIC_NETWORK_GATEWAY=<Public_Network_gateway>
FLOATING_RANGE=<IP>/24
FIXED_RANGE=<range>/24
FIXED_NETWORK_SIZE=256

# Neutron – OVS, VxLAN, and ML2
Q_PLUGIN=ml2
Q_AGENT=openvswitch
Q_USE_DEBUG_COMMAND=True
Q_L3_ENABLED=True
Q_L3_ROUTER_PER_TENANT=True
ENABLE_TENANT_TUNNELS=True
TENANT_TUNNEL_RANGE=-1:1000
Q_ML2_TENANT_NETWORK_TYPE=vxlan
Q_USE_PROVIDERNET_FOR_PUBLIC=True
OVS_BRIDGE_MAPPINGS=public:br-eth0
OVS_ENABLE_TUNNELING=True
PUBLIC_BRIDGE=br-eth0

# Nova
disable_service n-net
VIRT_DRIVER=libvirt

# Pip
PIP_USE_MIRRORS=False
USE_GET_PIP=1

# Logging
SCREEN_LOGDIR=/opt/stack/logs

# Tempest
enable_service tempest
TEMPEST_HTTP_IMAGE=127.0.0.1

# skydive
disable_service n-net
ENABLED_SERVICES+=,q-svc,q-dhcp,q-meta,q-agt,q-l3

10- Now, move to devstack directory and start the stack:
“cd devstack/”
“./stack.sh”

It will generally take around 2-3 hours depending on your Internet connection for DevStack to be downloaded and installed on your system. Once it’s completed, you can begin your OpenStack development and start contributing as well!

Please leave a comment if you have any issues!

Cheers!

Reference: DevStack | openstack | OpenContrail-Devstack

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s