Press "Enter" to skip to content

Dealing with OpenStack – Installation

OpenStack-Logo-Sized-Right

Index:
Part1 – Introduction
Part2 – Installation
Part3 – Configuration
Part4 – Running a VM

 

In this post I will share with you all the steps I followed to build my own OpenStack lab.

As of today, the current OpenStack version is Mitaka.

Some considerations first

Before starting, you should take some time to read and understand all the services used in OpenStack, like Nova, Neutron, Glance, etc… Here you can find a good and complete overview from the official documentation.

After some good reading you will need to decide how you want to deploy OpenStack. In my lab I used three VMs: 1 for the controller node, 1 for the compute node and 1 for the network node.

Here is the infrastructure:

os_infra

Talking about networking: all the nodes are connected to the same management network (10.0.0.0/24). According to this article and following this scheme:

Compute and network node networking scheme

The compute node and the networking node are sharing a private network (10.1.0.0/24) bridged to the virtual interface br-tun, used to connect VMs running on the compute node (or nodes) to the the network node and then to the provider network. Accessing VMs from outside is possible through the network node. The physical interface 10.2.0.15 is bridged with br-ex and VMs can communicate through the virtual router.

All these components are deployed during the installation process. Later on this post I will configure each of them.

The network gateway, a small Debian box that also acts as DNS, is connected to the management network, and routes traffic between all the networks. To enable the routing option just set the following in /etc/sysctl.conf:

net.ipv4.ip_forward = 1

My storage will be the local disk of the compute node so, in this post, I will not configure any kind of block or object storage.

 

Prepare the environment

For each VM you need to install CentOS 7 (minimal install), set the hostname and configure the network. If you are using a non English locale, make sure your /etc/environment is populated:

$ cat /etc/environment

LANG=en_US.utf-8
LC_ALL=en_US.utf-8

Execute the following commands as root or with sudo:

systemctl disable firewalld
systemctl stop firewalld
systemctl disable NetworkManager
systemctl stop NetworkManager
systemctl enable network
systemctl start network

On the controller node, install the RDO repository RPM and setup the repository:

yum install -y https://rdoproject.org/repos/rdo-release.rpm
yum install -y centos-release-openstack-mitaka
yum update -y

And then install Packstack:

yum install -y openstack-packstack

Generate the answer file:

packstack --gen-answer-file=packstack_answer-$(date +'%Y%m%d').txt

 

Customize the answerfile

At this point we have a fresh generated answer file and we need to define how we want to deploy OpenStack.

Set the following variables accordingly to your IP address plan:

$ grep '10.0.*' packsta* | grep -v '#'

CONFIG_CONTROLLER_HOST=10.0.0.10
CONFIG_COMPUTE_HOSTS=10.0.0.20
CONFIG_NETWORK_HOSTS=10.0.0.15
CONFIG_STORAGE_HOST=10.0.0.10
CONFIG_SAHARA_HOST=10.0.0.10
CONFIG_AMQP_HOST=10.0.0.10
CONFIG_MARIADB_HOST=10.0.0.10
CONFIG_KEYSTONE_LDAP_URL=ldap://10.0.0.10
CONFIG_MONGODB_HOST=10.0.0.10
CONFIG_REDIS_MASTER_HOST=10.0.0.10

Remove unneeded (for my purpose) component setting the flag to ‘n’:

CONFIG_MANILA_INSTALL=n
CONFIG_SWIFT_INSTALL=n
CONFIG_CEILOMETER_INSTALL=n
CONFIG_AODH_INSTALL=n
CONFIG_GNOCCHI_INSTALL=n
CONFIG_SAHARA_INSTALL=n
CONFIG_HEAT_INSTALL=n
CONFIG_TROVE_INSTALL=n
CONFIG_IRONIC_INSTALL=n
CONFIG_NAGIOS_INSTALL=n

Start the installation

Everything is now supposed to be set, so we can proceed with the installation:

packstack --answer-file=packstack_answer*.txt

 

Network configuration

Just few steps left: bridging the interface br-int on compute and network node and configuring br-ex on network node.

Compute Node

Backup the actual network configuration:

tar cvf ./backup_network-config.tar /etc/sysconfig/network-scripts/ifcfg-en*

Create the file /etc/sysconfig/network-scripts/ifcfg-br-tun and fill it with the following:

NAME="br-tun"
DEVICE="br-tun"
DEVICETYPE=ovs
TYPE=OVSBridge
ONBOOT=yes
IPV6INIT=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPADDR=10.1.0.20
PREFIX=24

Edit the file /etc/sysconfig/network-scripts/ifcfg-en* (use your interface connected to the private network – in my case eno33554960) and bridge it to br-tun:

NAME="eno33554960"
DEVICE="eno33554960"
ONBOOT=yes
IPV6INIT=no
BOOTPROTO=none
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-tun

 

Network Node

Backup the actual network configuration:

tar cvf ./backup_network-config.tar /etc/sysconfig/network-scripts/ifcfg-en*

Create the file /etc/sysconfig/network-scripts/ifcfg-br-tun and fill it in with the following:

NAME="br-tun"
DEVICE="br-tun"
DEVICETYPE=ovs
TYPE=OVSBridge
ONBOOT=yes
IPV6INIT=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPADDR=10.1.0.15
PREFIX=24

Edit the file /etc/sysconfig/network-scripts/ifcfg-en* (use your interface connected to the private network – in my case eno33554960) and bridge it to br-tun:

NAME="eno33554960"
DEVICE="eno33554960"
ONBOOT=yes
IPV6INIT=no
BOOTPROTO=none
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-tun

Create the file /etc/sysconfig/network-scripts/ifcfg-br-ex and fill it in with the following:

NAME="br-ex"
DEVICE="br-ex"
DEVICETYPE=ovs
TYPE=OVSBridge
ONBOOT=yes
IPV6INIT=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPADDR=10.2.0.15
PREFIX=24

Edit the file /etc/sysconfig/network-scripts/ifcfg-en* (use your interface connected to the provider network – in my case eno50332184) and bridge it to br-tun:

NAME="eno50332184"
DEVICE="eno50332184"
ONBOOT=yes
IPV6INIT=no
BOOTPROTO=none
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-ex

Reboot both the network and the compute node to apply the new settings.

 

Conclusion

If everything went fine now you should be able to access the management dashboard via browser by pointing the IP address of the controller node:

Screenshot at 2016-09-04 16^%24^%36

 

In the next post dedicated to this series I will configure the OpenStack infrastructure: all the internal components and create a VM.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *