ThorneLabs

Deploy Rackspace Private Cloud v4.1.x powered by OpenStack Grizzly with nova-network 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.1.x on top of:

Deploy Rackspace Private Cloud v4.1.x on Ubuntu Server 12.04.4 with nova-network

Create file Vagrantfile with the following contents:

Vagrantfile: vagrantfile-manual-rpcv415-ubuntu-nova-network
# -*- 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"

    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"

    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"]
    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"

    compute1_config.vm.provider "vmware_fusion" do |v|
        v.vmx["memsize"] = "2048"
        v.vmx["numvcpus"] = "2"
        # eth2 left unconfigured so the Chef Cookbooks can configure it
        v.vmx["ethernet2.present"] = "TRUE"
        v.vmx["ethernet2.connectionType"] = "hostonly"
        v.vmx["ethernet2.addressType"] = "generated"
        v.vmx["ethernet2.virtualDev"] = "e1000"
    end

    compute1_config.vm.provider "virtualbox" do |v|
        v.customize ["modifyvm", :id, "--memory", "2048"]
        v.customize ["modifyvm", :id, "--cpus", "2"]
        # eth2 left unconfigured so the Chef Cookbooks can configure it
        v.customize ["modifyvm", :id, "--nic3", "intnet"]
    end
  end
  # End compute1
end

Deploy Rackspace Private Cloud v4.1.x on CentOS 6.5 with nova-network

Create file Vagrantfile with the following contents:

Vagrantfile: vagrantfile-manual-rpcv415-centos-nova-network
# -*- 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"

    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"

    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"]
    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"

    compute1_config.vm.provider "vmware_fusion" do |v|
        v.vmx["memsize"] = "2048"
        v.vmx["numvcpus"] = "2"
        # eth2 left unconfigured so the Chef Cookbooks can configure it
        v.vmx["ethernet2.present"] = "TRUE"
        v.vmx["ethernet2.connectionType"] = "hostonly"
        v.vmx["ethernet2.addressType"] = "generated"
        v.vmx["ethernet2.virtualDev"] = "e1000"
    end

    compute1_config.vm.provider "virtualbox" do |v|
        v.customize ["modifyvm", :id, "--memory", "2048"]
        v.customize ["modifyvm", :id, "--cpus", "2"]
        # eth2 left unconfigured so the Chef Cookbooks can configure it
        v.customize ["modifyvm", :id, "--nic3", "intnet"]
    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.1.x powered by OpenStack Grizzly Chef Cookbooks:

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

cd chef-cookbooks

git checkout v4.1.5
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 rpcv415 -d "Rackspace Private Cloud v4.1.5 powered by OpenStack Grizzly"

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 rpcv415

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

{
    "name": "rpcv415",
    "description": "Rackspace Private Cloud v4.1.5 powered by OpenStack Grizzly",
    "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": "nova",
                "public_interface": "br-eth2"
            },
            "networks": {
                "public": {
                    "label": "public",
                    "bridge_dev": "eth2",
                    "bridge": "br-eth2",
                    "ipv4_cidr": "192.168.205.0/24",
                    "dns1": "8.8.4.4",
                    "dns2": "8.8.8.8"
                }
            }
        },
        "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"
        }
    }
}

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

ssh-keygen

Copy the SSH Public Key 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 rpcv412

knife bootstrap compute1 --environment rpcv412

Add the single-controller role to the controller1 node:

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

Add the single-compute role to the compute1 node:

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

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.

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.

Next Steps

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

See the Spinning Up Your First Instance on Rackspace Private Cloud using nova-network post for the next steps to follow.

References