Setting up a Single Node Openstack Environment

Here we are going to deploy openstack on a single node, i.e all openstack components Nova, Glance, Keystone, Quantum and Horizon will be running in the same box. Nova-compute is also running on the same machine which will provision virtual machines on the KVM.

Requirements:

Ubuntu 12.04 running on Oracle VirtualBox with two NIC ‘s.

  • Setup a ubuntu virtual machine in virtualBox.
  • Add a second NIC to the VM.
    • Power Off the Virtual Machine
    • Right Click on the VM and select settings
    • In the Network Section select Adapter 2 tab
    • Select “Attached to:” to internal

1.1

  • Power On the VM
  • When the VM boots up configure to network for second NIC
  • Edit /etc/network/interfaces to something like

2

  • Restart Network service

service networking restart

  • You can verify your network setting using “ ifconfig ”

ifconfig

Deploying Openstack

  • Login to the ubuntu VM.
  • Change the user to root.

sudo -i

  • If your network is behind proxy then please export proxy variables.

export http_proxy=<proxy-server>
export https_proxy=<proxy-server>
export no_proxy=”localhost,127.0.0.1″

  •  Install git on the machine

apt-get update -y

apt-get install git -y

  • Clone the CloudGear git to install Openstack

git clone https://github.com/ilearnstack/cloudgear.git

  • Execute the script to set up openstack

cd cloudgear/
python cloudgear.py

  • Open Openstack Dashboard in browser from URL  http://<controller-ip>/horizon
  • Login with credentials  admin/secret

horizon_1

  • Add a image into Glance

                     Download image from the given link :http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img

horizon_2

horizon_3 horizon_4

  • Create Network for Virtual Machines.

horizon_5 horizon_6 horizon_7

  • Create subnet for the network created above.

horizon_8

  • Launch a instance from the Project Tab , Instances page.

horizon_9 horizon_10

horizon_21

  • Once VM is successfully spawned it will show as ACTIVE in Instances page. 

horizon_22 horizon_23

  • Select Console tab to view VM console.

horizon_34

Setting up Ubuntu virtual machine in Oracle Virtualbox

VirtualBox is a free virtualization software offered by oracle for running virtual machines inside it. We are going to walk through creating a virtual machine inside virtualbox and installing Ubuntu server 12.04 LTS (Precise Pangolin) which comes with Openstack Folsom release .

Step 1: Creating a new virtual machine in virtulbox.

  1. Download and install Oracle Virtualbox from https://www.virtualbox.org/wiki/Downloads .
  2. Open Virtualbox .
  3. Click “New” button to create new virtual Machine .
  4. Give a name to the virtual machine. Select Type as “Linux” and version “Ubuntu (64 bit)” .1
  5. Select memory(RAM) as 1GB .select ram
  6. Press Next with default option on “Create a new virtual hard drive now” .create_vdisk
  7. Select disk type as “VMDK” which is also compatible with Vmware Workstation.createvdisk2
  8. Select “Dynamically allocated” option which will allocate the space as and when data is created.If you select the option “Fixed size”, it will allocate the total disk space at once. createvdisk3
  9. Allocate the disk space . I have selected 32GB to be the vm disk space. createvdisk4
  10. VM is created now, but it does not have any operating system installed inside it. We will now install ubuntu 12.04 inside this newly created virtual machine.vmcreated

Step 2 : Installing ubuntu 12.04 inside Virtualbox virtual machine.

  1. Download Ubuntu server 12.04 LTS iso from http://www.ubuntu.com/download/server .
  2. Power on the vm and select “Choose a virtual CD/DVD disk file” from “Devices->CD/DVD Devices”.8
  3. Attach the download iso to the VM and reset the VM from “Machine->Reset”.
  4. VM will boot with the attached ISO. Select “English” as language.10
  5. select “Install Ubuntu Server” .11
  6. Select installation language as “English” .12
  7. Select your country.13
  8. Configure your keyboard Layout. 141516
  9. Enter the hostname. This will be name of the system.17
  10. Create user for accessing the machine as a non root user .18 19 20 21
  11. Configure system clock.22
  12. Partition the disk. Use default options.2324252627
  13. Configure the proxy if your network is behind a proxy server.28
  14. Select update policy.29
  15. Install “OpenSSH server” with the OS so that we can directly login via ssh. Press space to select the option.30
  16. Install GRUB boot loader. 31
  17. Ubuntu installation is now complete.32
  18. Ubuntu vm is ready to use now. Login with the user created above.33

Note  :  If you cannot ping/ssh to the VM from the Host Machine then change the Network Settings to “Bridged Adapter”

  • Power Off the Virtual Machine
  • Right Click on the VM and select settings
  • Select “Attached to:” to Bridged Adapter
  • Power On the VM