Apr 242013

This is a post of how helpful people are in the OpenStack community. If you were to visit the lobby of Hilton Executive tower in Portland last Wednesday, you would have seen me and a couple other people making the cloud of USB sticks.

Last Thursday, I gave my first ever conference talk/tutorial at the OpenStack Summit. The goal of my tutorial was to show how to use Razor, and how easy it is to install OpenStack with it. There were a couple issues I had to solve for this tutorial: what is the fastest way to get people to have a running Razor on their system and how to do so over not very reliable internet connection.

To solve the first issue, I created a VM that had all the necessary components installed on it, everything from Razor to Chef server. Just to give some perspective, it takes just over an hour to download and setup all the major components, including loading cookbooks for OpenStack installation and loading them to the Chef server. Considering that my talk needed to be under 1 hour, live install would not have been a good option.

After I got to the conference, I realized that there is no way I can share my 3.6 GB VM over the intertubes! I probably should have timed downloading the VM over the regular (not on infinite work bandwidth) internet, to realize that it was a bad idea anyways. Luckily for me, I got some help. First, I talked to the Rackspace Private Cloud training team, and they provided me with wireless routers for setting up local network for sharing VM over internal network. The day of the talk, super helpful @Thediopter actually configured the routers for me, in record time! This local network allowed me to serve the file off my laptop while I was giving the talk.

Since I was not sure wireless local network was going to work, I decided that I needed to put my VM on USB sticks. I knew that eNovance is giving out USB drives at their vendor booth. I shared my problem with them, and they happily supplied me with a lot of USB drives. Going by the Suse booth, I noticed that they too had USB drives, and I asked if I could have some for my talk. They gladly supplied me with additional drives.

By now, I had 45 drives, and a limited amount of time to copy my VM to them. Surely there is a better way to copy something to a USB drive than one at the time. As I was walking by the Piston booth, I was asked about the USB sticks. I repeated my story of needing to make lots of USB sticks, and what do you know? I walked away with a 10 port USB hub!

Back at the hotel lobby, the baking of the USB sticks began. My coworkers helped me out with a little script to run on my mac to copy, and all I have to say, I am not sure where I would have been without them!

So, if you ever find yourself with a mac, USB hub, and lots of USB drives, this is how you copy to them on a command line. First, make sure you are root, then:

for i in `jot 10 2`; do asr --noverify --erase --noprompt --source /dev/disk1s1 --target /dev/disk${i}s1 & done

What this script is doing: copying from /dev/disk1s1 to all the other disks (USB drives), erasing destination, and does not verify anything. This process may take a while, but it is still faster than copying one at the time.

So, thanks again to everyone that helped out in the making of the USB cloud!


Curious what was on the USB drives? This.


 Posted by at 6:17 pm
Apr 232013

Instead of having everyone to install Razor to demo it during the OpenStack Summit in Portland, I created a Razor appliance. Installing and configuring Razor is not difficult, but could be a little time consuming if you do not have either Puppet or Chef already set up and configured. You can, of course, install it manually or go the Vagrant route: https://github.com/blueboxgroup/razor-vagrant-lab.

Slides for the OpenStack Summit tutorial can be found here: http://www.slideshare.net/mattray/bare-metal-to-openstack-with-razor-and-chef (thanks @mattray)

Razor VM

For creating Razor VM, I used Ubuntu 12.04 server. It has the following installed and configured:

Razor (installed using chef: https://github.com/bbg-cookbooks/razor)
TFTP server
DHCP server
Chef server (loaded with Rackspace Private Cloud cookbooks https://github.com/rcbops/chef-cookbooks)
MicroKernel and Ubuntu server ISO loaded

The VM needs to have 2 nics, one for internal, and one for external traffic.

Download VM from here (3.6 GB download): http://anystacker.com/files/razor.tar and un-tar it.

Load it either into VMware Fusion or VirtualBox. Please see bellow for special instructions for either!

Login, and switch to root:
username: anystacker
password: razor

Verify Razor is running:

  • root@razor:~# /opt/razor/bin/razor_daemon.rb status

If it is not running, start it up:

  • root@razor:~# /opt/razor/bin/razor_daemon.rb start

Now you can start using Razor. Here are some useful commands:

  • razor image
  • razor node
  • razor active_model
  • razor model
  • razor broker
  • razor policy

Running Razor is not very interesting, unless you try to create a new VM and watch Razor boot it. For this to happen, you will need to create a new VM in either Fusion or VirtualBox. The new VM needs to have a nic on internal network in order to be booted by razor. There are a couple special considerations, depending whether you are using VirtualBox or VMware Fusion.

VMware Fusion

While importing the appliance into Fusion, you may be presented with some errors/warnings. Dismiss them, it should work anyways.

If you are using Fusion, under Preferences/Network, make sure DHCP is disabled for the private network:


Razor appliance will need two nics, public and private. Make sure nic #1 is public:


Razor appliance nic #2 should be set to be on private network. Any subsequent VM to be booted by Razor should also be on private network:


Virtual Box

If you are using Virtual Box:

Make sure the extension pack is installed. To verify it, on command line type the following:

  • VBoxManage list extpacks

If you do not have extention pack, get it here:

When importing Razor appliance, accept all default settings, do not change anything. When creating a new VM to be booted by Razor, change boot order and set network to be internal.

For changing the boot order to include network boot, after creating a new VM, go to it’s Settings and under System, and select network boot order.


Once the boot order is set, change the VM network to be attached to internal network. It should look similar to this:


Now, once the new VM is powered on, it should start booting. If you are presented with an option to select a start up disk, cancel out of it. If Razor is listening on the right network, and your VM settings are correct, you should see something like this:


It should be followed by Razor Mikro Kernel loading information and then regular installation.


I did not try this myself, but @VMRandy was able to import the appliance into vSphere. First he uploaded it to Workstation, upgraded to hardware version 9, and then uploaded to vSphere. Once the VM was loaded and network configured, he was able to boot new nodes in vSphere using Razor.

If Things Don’t Work

Most likely, it is the network.

  • Check the settings, make sure Razor appliance has two nics, a public and a private.
  • Make sure there are no other DHCP servers affecting things and confusing your new VM.
  • Make sure the new VM is connecting on Private Network.
  • Make sure Razor appliance eth1 is listening on
  • Make sure Razor is running.
  • Make sure MongoDB is running.
  • If using Virtual Box, install extension pack.
  • If using Virtual Box, set boot order.

There are a few other things that could go wrong, but usually, it’s the network.

Everything Is Working, Now What?

Congratulations, you were able to download a large file from the internets, successfully imported into your favorite virtualization software, and deployed your first VM using Razor. If you list the Razor policies setup, you will notice that there are two of them. The second policy is for servers with two nics, and will install OpenStack for you on such servers. Go ahead and try- when creating a new server, make sure both nics are on private network. This time, spinning up a new server will take a little longer, as the Razor hands off the new node to the broker. The broker, in turn, will install chef client on it and run the initial run list. In our case, it is OpenStack installation.

Don’t stop at two servers! Try adding different policies and tags, and create servers with different configurations to match them. Check the “razor active_model” command, and see how it matches up with the “knife node list” command.

Have fun!


P.S.: about the making of USB sticks: http://anystacker.com/2013/04/the-making-of-cloud-of-usb-sticks/

P.S.S.: youtube video of the OpenStack Summit presentation: http://www.youtube.com/watch?feature=player_detailpage&v=Lal3aL5JH3o#t=183s


 Posted by at 12:50 am