How to install devstack on a single node setup

In a single node devstack setup, all the openstack services run on a single machine. The minimum physical requirements that need to be met are: 1 NIC connected to the internet (the management port can be used), 1 processor (1GHz or more), 2 GB RAM, 10 GB storage and a 64-bit version of your Linux distribution (64-bit because starting an openstack instance with a 64-bit image will not fail). Devstack attempts to support Ubuntu 14.04/16.04, Fedora 23/24, CentOS/RHEL 7, as well as Debian and OpenSUSE.

Before you begin installing devstack, make sure your machine is up to date with python (2.7 and above) and pip (6 and above) installed. I am using CentOS 7 and thus “yum”.

$sudo yum update

$sudo yum install python-devel

$sudo yum install epel-release

$sudo yum install pip

Great! You are now all set to stack up your machine!

The first step to install devstack is to clone the latest repository from github onto your machine. A folder called devstack will be created.

git clone https://git.openstack.org/openstack-dev/devstack

Next, create a stack user with sudo privileges because devstack should be run as a non-root user with sudo enabled.

devstack/tools/create-stack-user.sh; su stack

This step is the most important as it determines the configuration required to bring up your devstack environment. Create a local.conf file within the devstack folder with the following config

[[local|localrc]]

# IP of your host where devstack is running

HOST_IP=10.1.1.2

ADMIN_PASSWORD=devstack

MYSQL_PASSWORD=devstack

RABBIT_PASSWORD=devstack

SERVICE_PASSWORD=$ADMIN_PASSWORD

SERVICE_TOKEN=devstack

# Increase the Volume size to enable openstack instances running with OS images that occupy more memory

VOLUME_BACKING_FILE_SIZE=70000M

# Static IP for Openstack instances

FIXED_RANGE=10.0.0.0/24

FIXED_NETWORK_SIZE=256

# Give a floating ip range that has access to the public network (to ping Openstack instances from external network)

FLOATING_RANGE=10.1.0.0/25

Q_FLOATING_ALLOCATION_POOL=start=10.1.1.10,end=10.1.1.16

# br-ex will be given this ip to connect to external network

PUBLIC_NETWORK_GATEWAY=10.1.1.2

# Pip

PIP_USE_MIRRORS=False

USE_GET_PIP=1

RECLONE=True

# Logging

LOGFILE=$DEST/logs/stack.sh.log

SCREEN_LOGDIR=$DEST/logs/screen

VERBOSE=True

ENABLE_DEBUG_LOG_LEVEL=True

ENABLE_VERBOSE_LOG_LEVEL=True

#ML2 config

Q_PLUGIN=ml2

Q_AGENT=openvswitch

Q_ML2_PLUGIN_MECHANISM_DRIVERS=openvswitch,l2population

Q_ML2_PLUGIN_EXT_DRIVERS=port_security

SCHEDULER=nova.scheduler.chance.ChanceScheduler

disable_service n-net

disable_service tempest

enable_service n-novnc

enable_service n-cauth

ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-cauth

ENABLED_SERVICES+=,neutron,q-svc,q-agt,q-dhcp,q-l3,q-meta

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

ENABLED_SERVICES+=,g-api,g-reg,key

Run the command below from your devstack folder to begin stacking

./stack.sh

This will start your devstack installation. At the end of a successful installation, you should be able to see the link to your Horizon dashboard (in this case http://10.1.1.2/dashboard). You can login to your dashboard and create tenants, networks and instances.

Ping your openstack instances from the public network

Once create your openstack instances, you will not be able to ping them from the public network. This is because devstack creates a bridge “br-ex” in your machine to connect to the external network. So you should add the network interface (which is connected to the external network) as a port in “br-ex”. The IP address of the interface should be deleted before adding to the bridge.

Make sure to use console access for external network interface configuration as terminal connectivity will be lost while removing ip address.

  • sudo ip addr del <ip address> dev <ethX>
  • sudo ovs-vsctl add-port br-ex <ethX>

Now you have a fully functional devstack setup with connectivity to the external network!

Note: When you unstack, you might lose connectivity to your Node (because Openstack deletes br-ex). So as a work around you can assign the IP back to your ethX port and then unstack.