Monday, June 11, 2018

Deploying OpenStack on Ubuntu 16.04 with VirtualBox

I wanted to deploy my own OpenStack on a VM to do development testing. I initially faced a lot of issues with the deployment. Hence I wanted to document my steps to help others out.

OpenStack has their own Devstack that you can use for development testing.  So this documentation covers installing the Devstack on a Ubuntu 16.04 on VirtualBox.

  1. Install Ubuntu on VirtualBox and add 3 network adapters. 
    • NAT interface (enp0s3)
    • Host-Only interface (enp0s8)
    • Bridge Network
  2. Once you boot up into Ubuntu, run the command "sudo ifconfig" and it should give you the network adaptor names (shown above). Then add the following lines to the /etc/network/interfaces file.

    auto enp0s8
    iface enp0s8 inet static
    address 192.168.9.6
    netmask 255.255.255.0
    #gateway 192.168.9.1
    auto enp0s3
    iface enp0s3 inet dhcp

  3. Restart your network using
    sudo systemctl restart networking

  4. sudo apt-get update && sudo apt-get install git

  5. Configure the stack user (stack user would be running the Devstack)
    sudo useradd -s /bin/bash -d /opt/stack -m stack
    echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack

  6. Download devstack
    sudo su - stack
    git clone https://git.openstack.org/openstack-dev/devstack -b stable/pike

  7. Configure Devstack
    create a file named local.conf in the devstack directory and add the following minimal configurations. (cd devstack/ vi local.conf)

    [[local|localrc]]
    HOST_IP=192.168.9.6
    FLAT_INTERFACE= enp0s8
    ADMIN_PASSWORD=stack
    DATABASE_PASSWORD=$ADMIN_PASSWORD
    RABBIT_PASSWORD=$ADMIN_PASSWORD
    SERVICE_PASSWORD=$ADMIN_PASSWORD

  8. Run Devstack
    ./stack.sh
This will take a 15 - 20 minutes, largely depending on the speed of your internet connection. At the end you should have a working Devstack!

No comments:

Post a Comment