How to install OpenStack on multiple nodes

Last updated on October 18, 2012 by Dan Nanni

OpenStack is an open-source cloud management software that one can use to enable Infrastructure as a Service (IaaS) offerings. With major IT powerhouses such as HP, AT&T, IBM backing OpenStack, and a large pool of OpenStack developers contributing code to the project daily, OpenStack is fast becoming a de facto cloud standard. If you want to see OpenStack in action, it's a good idea to install it yourself on a small-scale (preferably at least two nodes).

In multi-node OpenStack installation, typically you set up everything except for Nova compute on one node (which is designated as a controller node), and provision Nova compute on the rest of nodes.

If you are a newbie with OpenStack, you will find devstack quite helpful in installing OpenStack. devstack is a script that automatically installs and configures the latest OpenStack pulled from the OpenStack git repository, and as such it is mainly used by OpenStack developers for upstream OpenStack development. However, the devstack script can as well used by OpenStack newbies for testing purposes.

Here is guide on how to install OpenStack on two nodes using devstack. I designate one node as controller node, and the other as compute node. OpenStack installation need to proceed on controller node first. In this setup, both nodes have Ubuntu 12.04 installed, and have 64-bit processors. The default installation of OpenStack uses KVM hypervisor for compute nodes, which requires 64-bit hypervisors.

How to Install OpenStack on Controller Node

We assume that the controller node has one network interface eth0, and has IP address 1.1.1.10 assigned to eth0.

First, add Linux user called stack and disable sudo password prompt for this user. OpenStack will run as this non-root user.

$ sudo useradd -U -G sudo -s /bin/bash -m stack
$ sudo sh -c 'echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers'

Then, set the local clock up-to-date by setting up NTP. If time is not synchronized among different nodes, the controller node will not be able to manage compute nodes properly.

Now log in as stack user. The rest of installation steps using devstack will proceed as stack user.

Once logged in as stack, go ahead and check out devstack repository.

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

You need to create a customized localrc file as follows, and put it in devstack directory.

$ vi localrc
HOST_IP=1.1.1.10
PUBLIC_INTERFACE=eth0
FLAT_INTERFACE=eth0
FIXED_RANGE=10.0.0.0/8
FIXED_NETWORK_SIZE=4096
FLOATING_RANGE=192.168.10.128/27
MULTI_HOST=1
ADMIN_PASSWORD=my_password
MYSQL_PASSWORD=my_password
RABBIT_PASSWORD=my_password
SERVICE_PASSWORD=my_password
SERVICE_TOKEN=my_password

Finally, run ./stack.sh

Once the script is finished without any error, run the following command to verify that all OpenStack services are enabled and running okay.

$ nova-manage service list
Binary           Host                     Zone    Status  State Updated_At
nova-compute     controller         nova   enabled  :-)   2012-09-25 16:43:07
nova-cert        controller         nova   enabled  :-)   2012-09-25 16:43:03
nova-scheduler   controller        nova   enabled  :-)   2012-09-25 16:43:03
nova-network     controller       nova   enabled  :-)   2012-09-25 16:43:02
nova-consoleauth controller         nova     enabled  :-)   2012-09-25 16:43:02

In the above, the status with smiley face means that a given service is running okay. If you see any status with XXX, it means that a corresponding service is not properly set up.

Since I do not want any guest VM to be deployed on the controller node, I disable nova-compute on controller node as follows.

$ nova-manage service disable --host=controller --service=nova-compute

Now the installation of OpenStack on controller node is done, and I move on to compute node set-up.

How to Install OpenStack on Compute Node

We assume that the compute node has one network interface eth0, and has IP address 1.1.1.20 assigned to eth0. In order to have VM console access, you must be able to access IP address 1.1.1.20 from your computer.

Similar to the controller node, create a new Linux user called stack, disable sudo password prompt, and configure NTP.

Log in as stack.

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

Create localrc as follows, and put it in devstack directory.

$ vi localrc
HOST_IP=1.1.1.20
FLAT_INTERFACE=eth0
FIXED_RANGE=10.0.0.0/8
FIXED_NETWORK_SIZE=4096
FLOATING_RANGE=192.168.10.128/27
MULTI_HOST=1
ADMIN_PASSWORD=my_password
MYSQL_PASSWORD=my_password
RABBIT_PASSWORD=my_password
SERVICE_PASSWORD=my_password
SERVICE_TOKEN=my_password
SERVICE_HOST=1.1.1.10
MYSQL_HOST=$SERVICE_HOST
RABBIT_HOST=$SERVICE_HOST
GLANCE_HOSTPORT=$SERVICE_HOST:9292
ENABLED_SERVICES=n-cpu,n-net,n-api,n-vol,n-novnc,n-xvnc

Finally, run ./stack.sh

Once the script is completed, this compute node is automatically registered with the controller. On controller node, run the nova-manage command to verify the status of services again.

$ nova-manage service list
Binary       Host                  Zone    Status   State Updated_At
nova-compute     controller                  nova   disabled :-)   2012-09-25 17:53:47
nova-cert        controller                  nova   enabled :-)   2012-09-25 17:53:47
nova-scheduler   controller                   nova   enabled  :-)   2012-09-25 17:53:47
nova-network     controller                   nova   enabled  :-)   2012-09-25 17:53:47
nova-consoleauth controller                   nova     enabled  :-)   2012-09-25 17:53:46
nova-compute     compute                nova   enabled   :-)   2012-09-25 17:54:48
nova-network     compute                nova     enabled     :-)   2012-09-25 17:54:50
nova-volume      compute                 nova     enabled     :-)   2012-09-25 17:54:52

You will see that three new services (nova-compute, nova-network and nova-volume) have been enabled on compute node. On the other hand, nova-compute on controller node has been disabled properly.

OpenStack installation on two nodes is finally completed. Now go to http://1.1.1.10/ to access OpenStack dashboard (use admin/my_password to log in), and you are set to go!

In case OpenStack installation does not work as expected for any reason, it may be a good idea to enable detailed logging in OpenStack for debugging purposes.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean