Thursday, 14 February 2013

Openstack Quick Start- Installing Openstack

Openstack Quick Start-
Installing Openstack

PART 2


In our previous post, we looked at how to get started with Openstack using Ubuntu Cloud's Live CD in VMware Workstation.

In this post, we are going to actually install and configure Openstack out.

NOTE: These installation steps are ONLY meant for Ubuntu Cloud's Live CD and will not work on other OS's or Openstack distributions. This is just for exploring Openstack in a quick and easy manner.

Assuming that you have booted from the Live CD (as described in the EARLIER POST), you should get a screen as shown below:

All the instructions to get Openstack up and running are placed in the "GettingStarted.txt" file on the Desktop. Below, in the following steps, I'll be quoting the steps from the same guide.




So, the first thing to do is launch a Terminal window (Key combination Ctrl -- Alt -- T) and run the following script file:

$ nova-setup.sh

This script will essentially create a MySQL database that will be used by Nova for storing configuration information. 

Unless something goes wrong, there will be no output from this command, and it may take a few seconds to complete.




IMP NOTE: At this point, you need to make sure you have IP set up on your Ethernet interface (eth0). 

By default this system uses standard network manager for network configuration. If you have DHCP server on your network, it will automatically set an IP and you can skip this step. (VMware Workstation automatically handles IP allocation to VMs IF your VMs are hosted on the NAT / Host only Network adapters. For this tutorial, this VM was provided a Bridged Adapter as the network had a DHCP server to provide dynamic IPs)

In case you don't have DHCP server or you only have a WiFi connection, you need to set up the network manually. You can do that by using network manager or by using standard CLI tools:

    $ sudo ifconfig eth0 192.168.99.100 up

In case you don't have any other connection on this machine add default route too:

    $ sudo route add default gw 192.168.99.1

NOTE
: This demo assumes you'll be using eth0. If you'll be using some other ethernet interface please adjust /etc/nova/nova.conf and ~/bin/start-openstack.sh.
Once your network is set up, it's time to start nova and glance services.

This script will edit /etc/nova/nova.conf and adjust all variables for your environment:
 
$ start-openstack.sh




If there are no errors (as shown above) then you are now ready to start exploring your Openstack Cloud !!

Note down the IP address of your VM using the following command:

$ ifconfig

Launch a Web Browser and type in the IP address of your Ubuntu VM. You will be provided with a Openstack login page. Log in as 'ubuntu' user, with 'ubuntu123' password.
 
NOTE: This default username and password is preset by the config files that we executed in earlier steps


Once you have logged in, you can explore the each of the tabs provided to the left of the UI. A brief description is provided for each tab below:

Overview Tab:
This basically provides an Overview/ Usage summary of your Cloud's resources per each Project. You can view details of your Cloud's consumption once you start launching instances and volumes.


Services Tab:
Here, you can view the status of your Openstack Services, whether they are up and running or not.


Flavors Tab:
Here, you can create your custom VM flavors; aka sizes and configuration, using which your Cloud users will launch instances. Basically you can configure a per-defined set of virtual CPUs, RAM and Disk specification using which instance will be launched.


Images Tab:
The Images tab will show the list of VM Images that you can launch your Instances out of. Think of 'Images' as a 'VM Template'.


By default there will be no Images to display. But Ubuntu Cloud Live CD has bundled a small image (cirros) into the distribution that you can use to launch a test instance out of.

To do so, open a Terminal window and type in the following command as shown:

$ glance -T cloudlive -I ubuntu -K ubuntu123 -N \
   http://127.0.0.1:5000/v2.0/ add name="cirros"  
   is_public=true \ container_format=ovf disk_format=raw 
   /srv/cirros-0.3.0-x86_64-disk.img
 

What the following command will do is upload the 'cirros' image to Glance for the Project 'CloudLive' with the container format as 'OVF'. You can use the same syntax to upload your own custom images to Glance. (This is shown in the PART 3 Tutorial)

Once uploaded, refresh the browser and you will see the Image added successfully to Openstack.


Projects Tab:
This tab is useful for create different 'Projects', each of which can have its own set of users and quota of resources to consume. This is basically more of an administrative feature so that the Cloud Admin can allocate resources to each Project and then bill them (charge-back) according to consumption.


Users Tab:
Naturally, this tab helps you create users and associate them with individual 'Projects'
 

Quotas Tab:
This tab will help the Cloud Administrator set the quotas/ limits for a variety of resources such as volumes, RAM, number of instances etc. These values can be altered as per requirement of each 'Project'.



With this, we have successfully installed Openstack on our test Ubuntu system. 

In our NEXT PART, we will be demonstrating the steps of actually working with Openstack; including creating your own Projects and users, creating key pairs, security groups and including launching an instance..

So stay tuned !!




No comments :

Post a Comment