Wednesday 23 April 2014

OpenStack in Ubuntu 12.04

CLOUD COMPUTING via OPENSTACK IN Ubuntu 12.04

Ubuntu Cloud

Cloud computing is a computing model that allows vast pools of resources to be allocated on-demand. These resources such as storage, computing power, network and software are abstracted and delivered as a service over the Internet anywhere, anytime. These services are billed per time consumed similar to the ones used by public services such as electricity, water and telephony. Ubuntu Cloud Infrastructure uses OpenStack open source software to help build highly scalable, cloud computing for both public and private clouds.

Prerequisites

To deploy a minimal Ubuntu Cloud infrastructure, you'll need at least:

  • One dedicated system.

  • Two network address ranges (private network and public network).

  • Make sure the host in question supports VT ( Virtualization Technology ) since we will be using KVM as the virtualization technology. Other hypervisors are also supported such as QEMU, UML, Vmware ESX/ESXi and XEN. LXC (Linux Containers) is also supported through libvirt.

Preconfiguring the network

1. Install bridging support
       sudo apt-get install bridge-utils
2. Install and configure NTP
       sudo apt-get install ntp
3. Add these two lines at the end of the /etc/ntp.conf file.
       server 127.127.1.0 fudge 127.127.1.0 stratum 10
4. Restart ntp service
       sudo service ntp restart

5. Install and configure MySQL

       sudo apt-get install mysql-server
6. Create a database and mysql user for OpenStack
       sudo mysql -uroot -ppassword -e "CREATE DATABASE nova;" sudo mysql -uroot -ppassword -e "GRANT ALL ON nova.* TO novauser@localhost \  
 IDENTIFIED BY 'novapassword';" 


Install OpenStack Compute (Nova)

1. Install OpenStack Nova components
        sudo apt-get install nova-api nova-network nova-volume nova-objectstore
        nova-scheduler \ nova-compute euca2ools unzip

2. Restart libvirt-bin just to make sure libvirtd is aware of ebtables.
        sudo service libvirt-bin restart

3. Install RabbitMQ - Advanced Message Queuing Protocol (AMQP)
        sudo apt-get install rabbitmq-server

 
4. Edit /etc/nova/nova.conf and add the following:
# Nova config FlatDHCPManager --sql_connection=mysql://novauser:novapassword@localhost/nova --flat_injected=true --network_manager=nova.network.manager.FlatDHCPManager --fixed_range=10.0.0.0/24 --floating_range=10.153.107.72/29 --flat_network_dhcp_start=10.0.0.2 --flat_network_bridge=br100 --flat_interface=eth1 --public_interface=eth0


5. Restart OpenStack services
for i in nova-api nova-network nova-objectstore nova-scheduler nova-volume nova-compute; \ do sudo stop $i; sleep 2; done


6. Migrate Nova database from sqlite db to MySQL db. It may take a while.
sudo nova-manage db sync

7. Define a specific private network where all your Instances will run. This will be used in the network of fixed Ips set inside nova.conf .
sudo nova-manage network create --fixed_range_v4 10.0.0.0/24 --label private \ --bridge_interface br100

8. Define a specific public network and allocate 6 (usable) Floating Public IP addresses for use with the instances starting from 10.153.107.72.
sudo nova-manage floating create --ip_range=10.153.107.72/29

9. Create a user (user1), a project (project1), download credentials and source its configuration file.
cd ; mkdir nova ; cd nova sudo nova-manage user admin user1 sudo nova-manage project create project1 user1 sudo nova-manage project zipfile project1 user1 unzip nova.zip source novarc

10. Verify the OpenStack Compute installation by typing:
sudo nova-manage service list sudo nova-manage version list