Deploy Rackspace Private Cloud v4.1.x powered by OpenStack Grizzly with nova-network Using VirtualBox or VMware Fusion and Vagrant

Sunday, September 29, 2013

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 going 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 created a Vagrantfile containing all of the same steps 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

curl https://raw.githubusercontent.com/jameswthorne/vagrantfiles-rpc/master/vagrantfile-manual-rpcv415-ubuntu-nova-network.txt -o Vagrantfile

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

curl https://raw.githubusercontent.com/jameswthorne/vagrantfiles-rpc/master/vagrantfile-manual-rpcv415-centos-nova-network.txt -o Vagrantfile

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 into 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 into 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 into 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

Installing OpenStack With Rackspace Private Cloud Tools



comments powered by Disqus