OpenStack Essex Install on 12.04

Many hours, days, nights and poor defenseless VMs were destroyed in preparing this how-to. There are some great scripts out there but for most engineers and architects we need to tear it apart look at the guts and put it back together. You are in luck. There are a lot of moving parts on the current OpenStack Essex release, so be prepared to drop MySql tables and rebuild. There is a troubleshooting post following this one to refer to as problems arise.

The OpenStack core components we are installing in this demo are Nova, Glance, Keystone and Dashboard. This will be the standard build for future design scenarios. This is killer software out of the box for data center orchestration built on top of killer modules.

Updated and verified July 12, 2012. Difference from the video is using a database for Keystone.

 

 

 

 

 

 

 

 

 

 

 

Figure 1. Two NICs on a host. Note* If you have one NIC you can use a vNIC i.e. eth0 & eth0:1

http://www.youtube.com/watch?v=S18xVjKndQE&hd=1

Prerequisites

The KVM requires an x86 machine with either Intel VT or AMD w/AMD-V support. Anything fairly new will have that support in the processor. There are a few older HW builds that support hardware assisted virtualization by enabling it in the bios. Pretty much Googling your machine for hardware virtualization will let you know. Qemu can be run on non VT HW but the machines will probably get brutalized by a few host VMs. When you are setting up the vSwitch either have an out of band or be on it physically. Be careful when you are adding multiple interfaces to bridges since you can spin up a bridging loop pretty quickly unless you have STP on. I recommend a test/dev network or mom's basement network. If not BPDUguard is your friend :) This is done on a fresh install of 64-bit Ubuntu 12.04 (Precise).

The starting Nic interface config looks like this in /etc/network/interfaces.

auto lo
iface lo inet loopback

#Frontend
auto eth0
iface eth0 inet static
	address 192.168.1.6 <--- Your Public interface goes here
	netmask 255.255.255.0
	network 192.168.1.0
	broadcast 192.168.1.255
	dns-nameservers 8.8.8.8
	gateway 192.168.1.1

#Backend
auto eth1
iface eth1 inet manual
	up ifconfig eth1 up

/*Updates $apt-get update $apt-get dist-upgrade

/*If not FQDN $nano /etc/hosts

127.0.0.1 localhost 127.0.1.1 openstack1

apt-get install ntp

/*Edit the NTP config to survive an Internet/Network outage: $nano /etc/ntp.conf

server ntp.ubuntu.com iburst server 127.127.1.0 fudge 127.127.1.0 stratum 10

/*Restart the service $service ntp restart

/*More packages $apt-get install tgt $apt-get install open-iscsi open-iscsi-utils $apt-get install bridge-utils

/*Restart Networking $/etc/init.d/networking restart

$apt-get install rabbitmq-server memcached python-memcache $apt-get install kvm libvirt-bin $apt-get install -y mysql-server python-mysqldb

/* Log into MySQL

$mysql -u root -p /*Create the Nova database with a password ‘openstack’

mysql -u root -popenstack -e 'CREATE DATABASE nova;'
mysql -u root -popenstack -e "GRANT ALL ON nova.* TO 'nova'@'%' IDENTIFIED BY 'openstack';"
mysql -u root -popenstack -e "GRANT ALL ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'openstack';"
mysql -u root -popenstack -e 'CREATE DATABASE keystone;'
mysql -u root -popenstack -e "GRANT ALL ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'openstack';"
mysql -u root -popenstack -e "GRANT ALL ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'openstack';"
mysql -u root -popenstack -e 'CREATE DATABASE glance;'
mysql -u root -popenstack -e "GRANT ALL ON glance.* TO 'glance'@'%' IDENTIFIED BY 'openstack';"
mysql -u root -popenstack -e "GRANT ALL ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'openstack';"

/*Edit my.cnf $nano /etc/mysql/my.cnf

/*from bind-address = 127.0.0.1 /*to bind-address = 0.0.0.0

$/etc/init.d/mysql restart

Keystone Identity Management

/*More packages $apt-get install keystone python-keystone python-keystoneclient

/*Edit keystone.conf $nano /etc/keystone/keystone.conf

/* Change ‘admin_token’ FROM #bind_host = 0.0.0.0 public_port = 5000 admin_port = 35357 admin_token = ADMIN /*TO #bind_host = 0.0.0.0 public_port = 5000 admin_port = 35357 admin_token = openstack

/*Also in Keystone.conf change the catalog values. If you dont change this you will get endpoint errors.

/*Change the catalog values FROM:

[catalog] driver = keystone.catalog.backends.sql.Catalog

TO:

[catalog] # driver = keystone.catalog.backends.sql.Catalog driver = keystone.catalog.backends.templated.TemplatedCatalog template_file = /etc/keystone/default_catalog.templates

Change from mysqlite to MySQL.

#connection = sqlite:////var/lib/keystone/keystone.db

TO:

[sql] connection = mysql://keystone:openstack@localhost:3306/keystone

Delete the sqlite db - sudo rm /var/lib/keystone/keystone.db

/*Restart the Keystone service $service keystone restart

/* Download and edit keystone-data.sh to have the proper password and token. /*Download the script to populate Keystone. It parses out IDs and adds them to the account and role creation (originally Devstack/RackBuilders I beleive so ty to them). here 

ADMIN_PASSWORD=${ADMIN_PASSWORD:-openstack}
SERVICE_PASSWORD=${SERVICE_PASSWORD:-$ADMIN_PASSWORD}
export SERVICE_TOKEN="openstack"
export SERVICE_ENDPOINT="http://localhost:35357/v2.0"
SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME:-service}

/*Save and run the keytone.sh script. Thanks to devstack for the script. $chmod +x keystone.sh $./keystone.sh

$chmod +x endpoints.sh 

/* Restart and Sync Keystone $/etc/init.d/keystone restart

$keystone-manage db_synch

Verify Users the following. If you get any errors make sure you have proper variables from a few steps back with the ’export’ command.

$keystone user-list

Installing Glance Image Management

$apt-get install glance glance-api glance-client glance-common glance-registry python-glance

/* Go ahead and add these to the end of /root/.bashrc or at the least paste into your terminal.
export SERVICE_TOKEN=openstack
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=http://localhost:5000/v2.0/
export SERVICE_ENDPOINT=http://localhost:35357/v2.0
/*Then refresh the shell. You can also use source novarc but keep it simple to start. $bash

We are going to change the following files /etc/glance/glance-registry-paste.ini (privileges) /etc/glance/glance-api-paste.ini (privileges) /etc/glance/glance-registry.conf (sql connection and flavor) /etc/glance/glance-api.conf (flavor)

$rm /var/lib/glance/glance.sqlite

/*Change the values to match below at the bottom of glance-registry-paste.ini $/etc/glance/glance-registry-paste.ini

admin_tenant_name = admin admin_user = admin admin_password = openstack

/*Change the values to match below at the bottom of glance-api-paste.ini $nano /etc/glance/glance-api-paste.ini

admin_tenant_name = admin admin_user = admin admin_password = openstack

/*Adjust mysql with privileges $nano /etc/glance/glance-registry.conf Replace sql_connection = sqlite:////var/lib/glance/glance.sqlite

sql_connection = mysql://glance:openstack@localhost/glance

/*Add this to the bottom of the file

[paste_deploy] flavor = keystone

/*Add flavors to /etc/glance/glance-api.conf at the bottom $nano /etc/glance/glance-api.conf

[paste_deploy] flavor = keystone

/* Restart for funzys $/etc/init.d/glance-api restart $/etc/init.d/glance-registry restart

/* Version control fix for 12.04 $glance-manage version_control 0 /*If you get errors on the following db_sync verify your variable by typing ‘export’.

/*Sync Glance with MySQL. $glance-manage db_sync

/* FYI The glance-registry process will complain and abend until you apply version control and synch. $/etc/init.d/glance-api restart $/etc/init.d/glance-registry restart

Continue with part2