Howto Create A Minimal Viable OpenStack Deployment With Devstack In Your Local LAN


Bicycle

Cheat Sheet Version

This will become a full fledged blog post. At this time it is just the happy-path description to get it running without much explanation.

Preparation

networking: be sure to load the driver for the USB 1GB nic

sudo add-apt-repository ppa:qji/ax88179
sudo apt-get update
sudo apt-get install ax88179
modprobe ax88179_178a

install bridge utils

apt-get install bridge-utils

add networking information to /etc/network/interfaces

auto eth1
iface eth1 inet manual
        up ifconfig eth1 promisc up
        down ifconfig eth1 promisc down

auto br0
iface br0 inet dhcp
        bridge_ports eth1
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0

eth0 and eth1 is configured to use promiscuous mode! This is extremely important. It is configured in the same way on the compute nodes. Promiscuous mode allows the interface to receive packets not targeted to this interface’s MAC address. Packets for VMs will be traveling through eth0/1, but their target MAC will be that of the VMs, not of eth0/1, so to let them in, we must use promiscuous mode.

root@testlab-3:~# ifconfig eth0 promisc up
root@testlab-3:~# ifconfig eth1 promisc up
root@testlab-3:~# ip a|grep -i pro
2: eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
3: eth1: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP qlen 1000

kvm

sudo apt-get install python-vm-builder
sudo apt-get install kvm libvirt-bin
sudo adduser ehaselwanter libvirtd
The user `ehaselwanter' is already a member of `libvirtd'.

bug in vmbuilder/grub

~# grep ext /usr/share/pyshared/VMBuilder/plugins/ubuntu/karmic.py
    preferred_filesystem = 'ext3'
mkdir /virts/

/usr/bin/vmbuilder kvm ubuntu -v --suite=precise --libvirt=qemu:///system --flavour=server --arch=amd64 --cpus=2 --mem=12288 --swapsize=2048 --rootsize=50480 --ip=10.0.0.222 --gw 10.0.0.1 --hostname=devstack --user=stack --name=stack --pass=stack --addpkg=git --addpkg=screen --addpkg=vim --addpkg=strace --addpkg=lsof --addpkg=nmap --addpkg=git --addpkg=acpid --addpkg=tcpdump --addpkg=python-pip --addpkg=wget --addpkg=htop --mirror=http://at.archive.ubuntu.com/ubuntu --components='main,universe' --addpkg=openssh-server --dns=8.8.8.8 --dest=/virts/devstack --bridge br0

Start and connect:

virsh start devstack
ssh stack@10.0.0.222
  • set the network to this
cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface

auto eth0
iface eth0 inet manual
  up ip l s $IFACE up
  up ifconfig eth1 promisc up
  down ip l s $IFACE down
  down ifconfig eth1 promisc down

#auto br-ex => moved to  /etc/rc.local see http;//developer.rackspace.com/blog/neutron-networking-simple-flat-network.html

iface br-ex inet static
        address 10.0.0.222
        netmask 255.255.255.0
        gateway 10.0.0.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 8.8.8.8
        dns-search defaultdomain

stack@devstack:~$ cat /etc/rc.local

ifup br-ex
exit 0
/ethc/init.d/network restart
ifconfig eth0 promisc up
ifconfig br-ex promisc up

Install Devstack

git clone https://github.com/openstack-dev/devstack.git
cd devstack
git checkout stable/havana

add config for bridged networking

cat localrc
HOST_IP=10.0.0.222
DATABASE_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_TOKEN=password
SERVICE_PASSWORD=password
ADMIN_PASSWORD=password
FLOATING_RANGE=10.0.0.0/24
FIXED_RANGE=172.24.4.0/24
FLAT_INTERFACE=eth0
LOGFILE=/home/stack/stack.sh.log
Q_FLOATING_ALLOCATION_POOL=start=10.0.0.128,end=10.0.0.159
PUBLIC_NETWORK_GATEWAY=10.0.0.1

disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service neutron

start a vm, associate a floating-ip, enjoy

Go Back explore our courses

We are here for you

You are interested in our courses or you simply have a question that needs answering? You can contact us at anytime! We will do our best to answer all your questions.

Contact us