Saturday, July 5, 2014

Install OpenStack Icehouse on Linux Debian based operating systems (Mint-17, Ubuntu-14.04-LTS)

OpenStack is a free and opensource IaaS platform. I found some difficulties while installing OpenStack on my Ubuntu 14.04 last week. Hence, I am writing to guide those who are like me :)

It would be great if you install OpenStack on a virtual machine. Install Oracle's Virtual Box. Then install Ubuntu or Mint on Virtual Box.

We are going to use DevStack to install OpenStack. DevStack is a script used to create OpenStack environment quickly.

Step-1 : Install Git

Install Git if you don't have Git installed on your system.

sudo apt-get update
sudo apt-get install git
 

Step-2 : Clone DevStack

Clone latest DevStack to a folder of your choice. Lets refer it as $DevStackHome. Run the following command on your terminal. It will create a folder (devstack) inside $DevStackHome and clone it.

git clone https://github.com/openstack-dev/devstack.git

 

Step-3 : Stack!

Navigate to devstack folder and run the following command to install OpenStack.

./stack.sh

Follow the instructions to install it. It will ask passwords for several modules (database, rabbit, service admin, service authentication) while installing. Would be good if you give same password to all.

Once it is installed successfully, you will get something like below on your terminal.


As you can see in the above log, you can access OpenStack @ http://10.0.2.15/project/


You might get the following error when installing it.

Resolving cdn.download.cirros-cloud.net (cdn.download.cirros-cloud.net)... failed: Name or service not known.
wget: unable to resolve host address 'cdn.download.cirros-cloud.net'
+ exit_trap
+ local r=4
++ jobs -p
+ jobs=
+ [[ -n '' ]]
+ kill_spinner
+ '[' '!' -z '' ']'
+ [[ 4 -ne 0 ]]
+ echo 'Error on exit'
Error on exit
+ ./tools/worlddump.py -d
usage: worlddump.py [-h] [-d DIR]
worlddump.py: error: argument -d/--dir: expected one argument

Refer this guide to find a workaround.

Step-4 : Unstack!

Don't forget to unstack OpenStack before shutting down your machine. If you do so, you can rejoin to the same session later.

Navigate to devstack folder and run the following command.

./unstack.sh

 

 Step-5 : Rejoin-Stack!

Don't forget to rejoin-stack OpenStack once you start your machine again. If you rejoin, you can access the previous session. If you stack, it will destroy all the previous sessions (settings, instances, images etc) and create a fresh OpenStack for you.

Navigate to devstack folder and run the following command.

./rejoin-stack.sh

If you rejoined, you can open a new tab/terminal to unstack. 

 

 Step-6 : Again Stack!

If you want to destroy previous sessions, you simply can stack.

Navigate to devstack folder and run the following command.

./stack.sh

That's all. Play with OpenStack!

Unable to resolve host address 'cdn.download.cirros-cloud.net' while installing OpenStack on Virtual Box

If you are installing OpenStack on a machine, running on Virtual Box, which is connected to a private network (lets say, to company wifi), you might get the following error.

Resolving cdn.download.cirros-cloud.net (cdn.download.cirros-cloud.net)... failed: Name or service not known.
wget: unable to resolve host address 'cdn.download.cirros-cloud.net'
+ exit_trap
+ local r=4
++ jobs -p
+ jobs=
+ [[ -n '' ]]
+ kill_spinner
+ '[' '!' -z '' ']'
+ [[ 4 -ne 0 ]]
+ echo 'Error on exit'
Error on exit
+ ./tools/worlddump.py -d
usage: worlddump.py [-h] [-d DIR]
worlddump.py: error: argument -d/--dir: expected one argument

It is trying to download Cirros OS image. As you can see in the error message, reason might be either the server is down or you are not allowed to access the server.

I tried to install OpenStack on a virtual machine running on virtual box using my company wifi. Installation failed several times with above message. PING is also not working.

Solution - 1

Edit stackrc file and give a download url that can be reached.

 

Solution -2 

Simple solution would be to use your dongle to install it. All the modules are downloaded already. Do not worry about data :)