ThorneLabs

Deploy Rackspace Private Cloud v4.2.x powered by OpenStack Havana with Neutron Networking Using VirtualBox or VMware Fusion and Vagrant

• Updated March 17, 2019


Rackspace Private Cloud, and OpenStack on its own, can be a formidable set of software to install. Rackspace Private Cloud uses Chef to deploy OpenStack, and while Chef itself has a high learning curve, its use does make deploying OpenStack easier and more scalable.

Despite this, I find a lot of installation confusion comes from how to setup the virtual machines. How many CPUs do I allocate? How much RAM do I allocate? How much storage should there be? How many NICs do I need and on what networks? Many people may give up at this point or attempt an install with incorrect virtual machine configurations which ruins their experience. However, Vagrant by Hashicorp makes it very easy to define the virtual machines all within a simple text file.

Before moving on, I recommend your workstation to have at least 2 physical CPUs and 8GB of RAM. If your workstation does not meet these recommended specifications, you can lower the amount of vCPUs and RAM assigned to each virtual machine in the Vagrantfile with the added risk of running into problems due to low resources.

If you would rather not go through the installation step-by-step, I have also created an all-in-one Vagrantfile containing all of the same steps to deploy Rackspace Private Cloud, so all you have to run is vagrant up.

Setup Vagrant

Download and install the latest version of Vagrant for your operating system.

Jump to either the Vagrant with VirtualBox or Vagrant with VMware Fusion section depending on what you want to use.

Using Vagrant with VirtualBox is free compared to using VMware Fusion which cost about $140.00 total.

Vagrant with VirtualBox

Download and install the latest version of VirtualBox for your operating system.

Once VirtualBox is installed, jump to the Setup a Vagrant Environment section.

Vagrant with VMware Fusion

First, purchase ($59.99), download, and install the latest version of VMware Fusion 5 or 6.

In addition, purchase ($79.00) the Vagrant VMware Provider License from HashiCorp; you cannot use Vagrant with VMware Fusion without this license.

Second, once you have purchased the plugin, open Terminal, and install the Vagrant VMware Fusion Provider Plugin:

vagrant plugin install vagrant-vmware-fusion

HashiCorp should have emailed you the Vagrant VMware Fusion Provider License by now. License the provider with the following command (save the license in a safe place, Vagrant will copy the license to it’s own directory as well):

vagrant plugin license vagrant-vmware-fusion ~/Downloads/license.lic

Verify everything is working by running any of the Vagrant commands. An error message will be thrown if there is something wrong.

Once VMware Fusion and the Vagrant Provider License are installed, jump to the Setup a Vagrant Environment section.

Setup a Vagrant Environment

Create a directory somewhere on your workstation to save your Vagrantfile and change into that directory:

mkdir -p ~/Development/vagrant-rpc

cd ~/Development/vagrant-rpc

Run one of the following commands based on which operating system you want to install Rackspace Private Cloud v4.2.x on top of:

Deploy Rackspace Private Cloud v4.2.x on Ubuntu Server 12.04.4 with Neutron Networking

Create file Vagrantfile with the following contents:

Vagrantfile: vagrantfile-manual-rpcv422-ubuntu-neutron-networking
# -*- mode: ruby -*-

# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version ">= 1.5.0"

$script = <<SCRIPT
# Silly Ubuntu 12.04 doesn't have the
# --stdin option in the passwd utility
echo root:vagrant | chpasswd

cat << EOF >> /etc/hosts
192.168.236.10 chef
192.168.236.20 controller1
192.168.236.30 compute1
EOF
SCRIPT

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.box = "ubuntu-server-12.04.4-lts-x86_64"
  config.vm.box_url = "http://public.thornelabs.net/ubuntu-server-12.04.4-lts-x86_64.box"

  config.vm.provider "vmware_fusion" do |v, override|
    override.vm.box = "ubuntu-server-12.04.4-lts-x86_64"
    override.vm.box_url = "http://public.thornelabs.net/ubuntu-server-12.04.4-lts-x86_64.vmware.box"
  end

  # Turn off shared folders
  config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true

  # Begin chef
  config.vm.define "chef" do |chef_config|
    chef_config.vm.hostname = "chef"

    chef_config.vm.provision "shell", inline: $script

    # eth1
    chef_config.vm.network "private_network", ip: "192.168.236.10"
    # eth2
    chef_config.vm.network "private_network", ip: "192.168.244.10"

    chef_config.vm.provider "vmware_fusion" do |v|
        v.vmx["memsize"] = "1024"
        v.vmx["numvcpus"] = "1"
    end

    chef_config.vm.provider "virtualbox" do |v|
        v.customize ["modifyvm", :id, "--memory", "1024"]
        v.customize ["modifyvm", :id, "--cpus", "1"]
    end
  end
  # End chef

  # Begin controller1
  config.vm.define "controller1" do |controller1_config|
    controller1_config.vm.hostname = "controller1"

    controller1_config.vm.provision "shell", inline: $script

    # eth1
    controller1_config.vm.network "private_network", ip: "192.168.236.20"
    # eth2
    controller1_config.vm.network "private_network", ip: "192.168.240.20"
    # eth3
    controller1_config.vm.network "private_network", ip: "192.168.244.20"

    controller1_config.vm.provider "vmware_fusion" do |v|
        v.vmx["memsize"] = "1536"
        v.vmx["numvcpus"] = "1"
    end

    controller1_config.vm.provider "virtualbox" do |v|
        v.customize ["modifyvm", :id, "--memory", "1536"]
        v.customize ["modifyvm", :id, "--cpus", "1"]
        v.customize ["modifyvm", :id, "--nicpromisc4", "allow-all"]
    end
  end
  # End controller1

  # Begin compute1
  config.vm.define "compute1" do |compute1_config|
    compute1_config.vm.hostname = "compute1"

    compute1_config.vm.provision "shell", inline: $script

    # eth1
    compute1_config.vm.network "private_network", ip: "192.168.236.30"
    # eth2
    compute1_config.vm.network "private_network", ip: "192.168.240.30"
    # eth3
    compute1_config.vm.network "private_network", ip: "192.168.244.30"

    compute1_config.vm.provider "vmware_fusion" do |v|
        v.vmx["memsize"] = "2048"
        v.vmx["numvcpus"] = "2"
    end

    compute1_config.vm.provider "virtualbox" do |v|
        v.customize ["modifyvm", :id, "--memory", "2048"]
        v.customize ["modifyvm", :id, "--cpus", "2"]
        v.customize ["modifyvm", :id, "--nicpromisc4", "allow-all"]
    end
  end
  # End compute1
end

Deploy Rackspace Private Cloud v4.2.x on CentOS 6.5 with Neutron Networking

Vagrantfile: vagrantfile-manual-rpcv422-centos-neutron-networking
# -*- mode: ruby -*-

# vi: set ft=ruby :

VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version ">= 1.5.0"

$script = <<SCRIPT
# Silly Ubuntu 12.04 doesn't have the
# --stdin option in the passwd utility
echo root:vagrant | chpasswd

cat << EOF >> /etc/hosts
192.168.236.10 chef
192.168.236.20 controller1
192.168.236.30 compute1
EOF
SCRIPT

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.box = "centos-6.5-x86_64"
  config.vm.box_url = "http://public.thornelabs.net/centos-6.5-x86_64.box"

  config.vm.provider "vmware_fusion" do |v, override|
    override.vm.box = "centos-6.5-x86_64"
    override.vm.box_url = "http://public.thornelabs.net/centos-6.5-x86_64.vmware.box"
  end

  # Turn off shared folders
  config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true

  # Begin chef
  config.vm.define "chef" do |chef_config|
    chef_config.vm.hostname = "chef"

    chef_config.vm.provision "shell", inline: $script

    # eth1
    chef_config.vm.network "private_network", ip: "192.168.236.10"
    # eth2
    chef_config.vm.network "private_network", ip: "192.168.244.10"

    chef_config.vm.provider "vmware_fusion" do |v|
        v.vmx["memsize"] = "1024"
        v.vmx["numvcpus"] = "1"
    end

    chef_config.vm.provider "virtualbox" do |v|
        v.customize ["modifyvm", :id, "--memory", "1024"]
        v.customize ["modifyvm", :id, "--cpus", "1"]
    end
  end
  # End chef

  # Begin controller1
  config.vm.define "controller1" do |controller1_config|
    controller1_config.vm.hostname = "controller1"

    controller1_config.vm.provision "shell", inline: $script

    # eth1
    controller1_config.vm.network "private_network", ip: "192.168.236.20"
    # eth2
    controller1_config.vm.network "private_network", ip: "192.168.240.20"
    # eth3
    controller1_config.vm.network "private_network", ip: "192.168.244.20"

    controller1_config.vm.provider "vmware_fusion" do |v|
        v.vmx["memsize"] = "1536"
        v.vmx["numvcpus"] = "1"
    end

    controller1_config.vm.provider "virtualbox" do |v|
        v.customize ["modifyvm", :id, "--memory", "1536"]
        v.customize ["modifyvm", :id, "--cpus", "1"]
        v.customize ["modifyvm", :id, "--nicpromisc4", "allow-all"]
    end
  end
  # End controller1

  # Begin compute1
  config.vm.define "compute1" do |compute1_config|
    compute1_config.vm.hostname = "compute1"

    compute1_config.vm.provision "shell", inline: $script

    # eth1
    compute1_config.vm.network "private_network", ip: "192.168.236.30"
    # eth2
    compute1_config.vm.network "private_network", ip: "192.168.240.30"
    # eth3
    compute1_config.vm.network "private_network", ip: "192.168.244.30"

    compute1_config.vm.provider "vmware_fusion" do |v|
        v.vmx["memsize"] = "2048"
        v.vmx["numvcpus"] = "2"
    end

    compute1_config.vm.provider "virtualbox" do |v|
        v.customize ["modifyvm", :id, "--memory", "2048"]
        v.customize ["modifyvm", :id, "--cpus", "2"]
        v.customize ["modifyvm", :id, "--nicpromisc4", "allow-all"]
    end
  end
  # End compute1
end

At this point you are ready to startup your Vagrant environment.

If you are using VirtualBox:

vagrant up

If you run into any errors while running vagrant up, try opening the VirtualBox application, letting it run in the background, and re-run vagrant up.

If you are using VMware Fusion:

vagrant up --provider vmware_fusion

If you run into any errors while running vagrant up --provider vmware_fusion, try running the following commands in Terminal, and re-run vagrant up --provider vmware_fusion:

sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --configure

sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop

sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start

Setup the Chef Server

Log in to your Chef Server:

vagrant ssh chef

Login as the root user and stay logged in as root throughout this process (the root password is vagrant):

su -

Install Chef Server:

curl -O https://raw.githubusercontent.com/rcbops/support-tools/master/chef-install/install-chef-server.sh

chmod +x install-chef-server.sh

export CHEF_URL="https://chef:443"

./install-chef-server.sh

Install the Rackspace Private Cloud v4.2.x powered by OpenStack Havana Chef Cookbooks:

git clone https://github.com/rcbops/chef-cookbooks.git

cd chef-cookbooks

git checkout v4.2.2
git submodule init
git submodule sync
git submodule update

knife cookbook upload -a -o cookbooks

knife role from file roles/*rb

Create the Chef Environment file:

knife environment create rpcv422 -d "Rackspace Private Cloud v4.2.2 powered by OpenStack Havana"

Edit the Chef Environment file. In the export command below, feel free to replace vim with nano or any other command line based text editor you are comfortable with.

export EDITOR=$(which vim)

knife environment edit rpcv422

Once the command line text editor opens with the default Chef Environment, delete everything and input the following Chef Environment Override Attributes:

{
    "name": "rpcv422",
    "description": "Rackspace Private Cloud v4.2.2 powered by OpenStack Havana",
    "cookbook_versions": {},
    "json_class": "Chef::Environment",
    "chef_type": "environment",
    "default_attributes": {},
    "override_attributes": {
        "nova": {
            "libvirt": {
                "virt_type": "qemu",
                "vncserver_listen": "0.0.0.0"
            },
            "network": {
                "provider": "neutron"
            }
        },
        "neutron": {
            "ovs": {
                "provider_networks": [
                    {
                        "label": "ph-eth3",
                        "bridge": "br-eth3"
                    }
                ],
                "network_type": "gre",
                "network": "neutron",
                "external_bridge": ""
            }
        },
        "mysql": {
            "allow_remote_root": true,
            "root_network_acl": "%"
        },
        "osops_networks": {
            "nova": "192.168.236.0/24",
            "public": "192.168.236.0/24",
            "management": "192.168.236.0/24",
            "neutron": "192.168.240.0/24"
        }
    }
}

Create a new password-less SSH Public/Private Key (use the defaults for anything prompted):

ssh-keygen

Copy the SSH Public Key to each node (password is vagrant):

ssh-copy-id root@controller1

ssh-copy-id root@compute1

Install and register Chef Client and set the Chef Environment on each node:

knife bootstrap controller1 --environment rpcv422

knife bootstrap compute1 --environment rpcv422

Add the single-controller and single-network-node roles to the controller1 node:

knife node run_list add controller1 'role[single-controller],role[single-network-node]'

Add the single-compute role to the compute1 node:

knife node run_list add compute1 'role[single-compute]'

The Chef Server is also going to act as a router of sorts for OpenStack Instance connectivity to the internet. Another virtual machine could also be created to do this, but for the sake of saving RAM, I will be configuring the Chef Server to do this.

Turn on IP forwarding:

echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf

sysctl -p

Packets ingress to eth2 are forwarded:

iptables -A FORWARD -i eth2 -j ACCEPT

Packets ingress to eth2 are NAT’d out eth0:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Setup the controller1 Node

Log in to your controller1 node:

vagrant ssh controller1

Login as the root user and stay logged in as root throughout this process (the root password is vagrant):

su -

Run chef-client (installation time will partly depend on your internet connection):

chef-client

If chef-client ran successfully, you should now have a working controller node.

The remaining steps in this section are optional, but if you want to fully utilize Neutron Networking and have internet access from your OpenStack Instances, you will need reconfigure eth3 so it can be attached to the Open vSwitch Bridge.

Follow the steps in one of the following two sections that matches the operating system you installed Rackspace Private Cloud on top of.

Ubuntu Network Configuration

Down eth3 and delete its IP address:

ip link set eth3 down

ip address delete 192.168.244.20/24 dev eth3

In /etc/network/interfaces, find auto eth3 and remove that line and the next three lines:

sed -i -e '/auto eth3/,+3d' /etc/network/interfaces

Append the new eth3 configuration to /etc/network/interfaces:

cat << 'EOF' >> /etc/network/interfaces
auto eth3
iface eth3 inet manual
    up ip link set eth3 up
    down ip link set eth3 down
     
iface br-eth3 inet static
    address 192.168.244.20
    netmask 255.255.255.0
EOF

Have br-eth3 come up on boot:

sed -i '/^exit 0$/i ifup br-eth3' /etc/rc.local

Up eth3 and br-eth3 and add an IP address to br-eth3:

ip link set eth3 up

ip link set br-eth3 up

ip address add 192.168.244.20/24 dev br-eth3

Add eth3 to the br-eth3 Open vSwitch Bridge:

ovs-vsctl add-port br-eth3 eth3

CentOS Network Configuration

Down eth3 and delete its IP address:

ip link set eth3 down

ip address delete 192.168.244.20/24 dev eth3

Open /etc/sysconfig/network-scripts/ifcfg-eth3, delete all the contents, and copy and paste the following:

DEVICE=eth3
BOOTPROTO=none
NM_CONTROLLED=no
ONBOOT=yes
TYPE=OVSPort
DEVICETYPE="ovs"
OVS_BRIDGE=br-eth3
IPV6INIT=no
USERCTL=no

Create /etc/sysconfig/network-scripts/ifcfg-br-eth3 and copy and paste the following:

DEVICE=br-eth3
ONBOOT=yes
BOOTPROTO=none
STP=off
NM_CONTROLLED=no
HOTPLUG=no
DEVICETYPE=ovs
TYPE=OVSBridge
IPADDR=192.168.244.20
NETMASK=255.255.255.0

Up eth3 and br-eth3 and add an IP address to br-eth3:

ip link set eth3 up

ip link set br-eth3 up

ip address add 192.168.244.20/24 dev br-eth3

Add eth3 to the br-eth3 Open vSwitch Bridge:

ovs-vsctl add-port br-eth3 eth3

Setup the compute1 Node

Log in to your compute1 node:

vagrant ssh compute1

Login as the root user and stay logged in as root throughout this process (the root password is vagrant):

su -

Run chef-client (installation time will partly depend on your internet connection):

chef-client

If chef-client ran successfully, you should now have a working compute node.

The remaining steps in this section are optional, but if you want to fully utilize Neutron Networking and have internet access from your OpenStack Instances, you will need reconfigure eth3 so it can be attached to the Open vSwitch Bridge.

Follow the steps in one of the following two sections that matches the operating system you installed Rackspace Private Cloud on top of.

Ubuntu Network Configuration

Down eth3 and delete its IP address:

ip link set eth3 down

ip address delete 192.168.244.30/24 dev eth3

In /etc/network/interfaces, find auto eth3 and remove that line and the next three lines:

sed -i -e '/auto eth3/,+3d' /etc/network/interfaces

Append the new eth3 configuration to /etc/network/interfaces:

cat << 'EOF' >> /etc/network/interfaces
auto eth3
iface eth3 inet manual
    up ip link set eth3 up
    down ip link set eth3 down
     
iface br-eth3 inet static
    address 192.168.244.30
    netmask 255.255.255.0
EOF

Have br-eth3 come up on boot:

sed -i '/^exit 0$/i ifup br-eth3' /etc/rc.local

Up eth3 and br-eth3 and add an IP address to br-eth3:

ip link set eth3 up

ip link set br-eth3 up

ip address add 192.168.244.30/24 dev br-eth3

Add eth3 to the br-eth3 Open vSwitch Bridge:

ovs-vsctl add-port br-eth3 eth3

CentOS Network Configuration

Down eth3 and delete its IP address:

ip link set eth3 down

ip address delete 192.168.244.30/24 dev eth3

Open /etc/sysconfig/network-scripts/ifcfg-eth3, delete all the contents, and copy and paste the following:

DEVICE=eth3
BOOTPROTO=none
NM_CONTROLLED=no
ONBOOT=yes
TYPE=OVSPort
DEVICETYPE="ovs"
OVS_BRIDGE=br-eth3
IPV6INIT=no
USERCTL=no

Create /etc/sysconfig/network-scripts/ifcfg-br-eth3 and copy and paste the following:

DEVICE=br-eth3
ONBOOT=yes
BOOTPROTO=none
STP=off
NM_CONTROLLED=no
HOTPLUG=no
DEVICETYPE=ovs
TYPE=OVSBridge
IPADDR=192.168.244.30
NETMASK=255.255.255.0

Up eth3 and br-eth3 and add an IP address to br-eth3:

ip link set eth3 up

ip link set br-eth3 up

ip address add 192.168.244.30/24 dev br-eth3

Add eth3 to the br-eth3 Open vSwitch Bridge:

ovs-vsctl add-port br-eth3 eth3

Next Steps

At this point Rackspace Private Cloud v4.2.x powered by OpenStack Havana should be installed. Now what?

See the Spinning Up Your First Instance on Rackspace Private Cloud using Quantum/Neutron Networking post for the next steps to follow.

References