Single Node OpenStack Startup

TurnToJPG -->

Following records the main steps for starting up the single node Openstack environment.

Ubuntu Setup and Configuration


Use virt-manager, create a new virtual machine, install the system from ubuntu-12.04.3-server-amd64.iso, allocate 2 CPU and 4096 Memory, allocate the 80GB disk.
Create disk via:

Trusty@pc119:~/Code/Virt-Manager/SingleNode> qemu-img create -f qcow2 SingleNode.qcow2 80G
Formatting 'SingleNode.qcow2', fmt=qcow2 size=85899345920 encryption=off cluster_size=65536 lazy_refcounts=off

Configure the networking, bridge, then beging installing.
IP address set to, gateway first we set it to, later we will change it, because it’s a pseudo-addresses.


First save a snapshot, shutdown the running virtual machine, then you could clone it for back up.
Configure the network in virtual machine via:

$ sudo ip route add default gw
$ sudo ip route add dev eth0

SSH fast connect:

$ sudo vi /etc/ssh/sshd_config
UseDNS no
$ sudo service ssh restart

Now you could ssh to the virtual machine and update corresponding configurations.

In fact the snapshot could be made here.
Transfer the installtion media to virtual machine:

$ scp ./contrail-install-packages_1.21-74\~havana_all.deb Trusty@

Install OpenContrail

Set the root password:

$ sudo bash
root@SingleNode:~# passwd
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

Install the deb file via:

root@SingleNode:~# ls
root@SingleNode:~# dpkg -i contrail-install-packages_1.21-74~havana_all.deb 

Now setup the whole packages.

root@SingleNode:/etc/apt# cd /opt/contrail/contrail_packages/
root@SingleNode:/opt/contrail/contrail_packages# ls
contrail_debs.tgz  preferences  sources.list  VERSION
root@SingleNode:/opt/contrail/contrail_packages# ./

Copy the example testbed file to

root@SingleNode:/opt/contrail/utils# cp fabfile/testbeds/ fabfile/testbeds/

Edit this file to, notice the + means we did modifications :

from fabric.api import env

#Management ip addresses of hosts in the cluster
+++ host1 = 'root@'

#External routers if any
#for eg. 
#ext_routers = [('mx1', '')]
ext_routers = []

#Autonomous system number
router_asn = 64512

#Host from which the fab commands are triggered to install and provision
+++ host_build = 'root@'

#Role definition of the hosts.
env.roledefs = {
    'all': [host1],
    'cfgm': [host1],
    'openstack': [host1],
    'control': [host1],
    'compute': [host1],
    'collector': [host1],
    'webui': [host1],
    'database': [host1],
    'build': [host_build],
    'storage-master': [host1],
    'storage-compute': [host1],

#Openstack admin password
env.openstack_admin_password = 'secret123'

env.hostnames = {
+    'all': ['SingleNode']

+++ env.password = 'rootpass'
#Passwords of each host
env.passwords = {
+++     host1: 'rootpass',

+++     host_build: 'rootpass',

#For reimage purpose
env.ostypes = {
+++    host1:'ubuntu',

Now use fab to install :

root@SingleNode:/opt/contrail/utils# fab -c fabrc install_contrail

This will take some minutes.
Then setup all:

# cd /opt/congrail/utils
# fab setup_all

After installation the machine will be reboot.
A snapshot will be created when reboot done, this will be the cloned initial startpoint for OpenContrail.


Create a simple web server via python:

python -m SimpleHTTPServer 8000

Then Create the image in OpenStack via: