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
MongoDB
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:

fusion_network_dhcp

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

fusion_public_nic

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:

fusion_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.

virtual_box_boot_order

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

virtual_box_network

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:

razor_boot_menu

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

vSphere

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 172.16.16.1.
  • 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!

-eglute

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

  8 Responses to “Getting Started Using Razor and Chef (Razor Appliance)”

  1. [...] Curious what was on the USB drives? This. [...]

  2. Using guide at http://www.datos.jp/www/?p=62
    I found you only need to change a few things in .ovf file:

    1) Change “VirtualSystemType” from “virtualbox-2.2″ to “vmx-07″
    2) Change “sata” to “scsi” on “sataController0″
    3) also change its ResourceType from “20″ to “6″
    4) also change its “ResourceSubType” from “AHCI” to “lsilogic”
    5) For “Item” heading entry of “sound” device add: ovf:required=”false”
    e.g.: Item ovf:required=”false”

    You should then be able to deploy directly in vsphere and then do a “Upgrade hardware version”

    Brian

  3. The blog post was a quite good & helpful one for razor beginner

    The reason why i am writing this email is to ask for your help regarding on isc-dhcp-server

    I followed your instruction and was able to install ubuntu 12.04 server on bare-metal VM server.

    But razor told the node state is broker_fail, so i checked the log file found out that the node IP was changed during os installation.

    According to razor wiki, because dhcp client is different in pxe boot and after os installation, isc-dhcp-server assigns a different IP.

    My question is that how to configure isc-dhcp-server to assign same ip regarding to same MAC.

    Or should i use dnsmasq instead of isc-dhcp-server?

    • Arahan,

      I seen this happen a lot! I think it happens when your server has no connection to the internet at the time of after OS install and between broker handoff. What you need to do is setup your dhcp server so that the same MAC address always gets the same IP address, whether it is not expiring their lease or setting up something in configuration file where mac and ip are tied together. I usually use dnsmasq, but you should be able to do the same with isc dhcp server.

      Try first setting increasing lease time:

      default-lease-time 7200;
      max-lease-time 7200;

      if that does not work, you will need to set fixed ip for each host:

      host haagen {
      hardware ethernet 08:00:2b:4c:59:23;
      fixed-address 192.168.1.222;
      }
      above settings are from: http://tldp.org/HOWTO/DHCP/x369.html

      Hope this helps!

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>