This is outdated. Razor has been rewritten from the ground up. See razor-server. If you are still using the depricated implementation go on reading :-)

The Project


OS Images


Field Test

Test Install used in Lab is at at /opt/razor/Razor/bin

To start over with a node in razor delete the active_model

root@admin:/opt/razor/Razor/bin# ./razor active_model remove 27qPG2GhliAq6SGw7mR7D8

Active_model remove_active_model_by_uuid
Active model 27qPG2GhliAq6SGw7mR7D8 removed

and reboot

  • IPMI for knife-razor (or knife baremetal) https://github.com/logicminds/ruby-freeipmi

dnsmasq config


Adding a Chef broker

Given a Chef server and already having created the image and the model, the automatic (Chef-) provisioning of nodes created bootstrapped using Razor works by adding a broker, i.e. proceed as follows (this is following fnichol’s razor_for_bare_ubuntu.sh script closely)

  1. add the downloaded image:
  razor image add \
    --type os \
    --path $precise_iso \
    --name ubuntu-amd64 \
    --version 12.04
  1. create a model:
  razor model add \
    --template ubuntu_precise \
    --image-uuid $image_uuid ubuntu-amd64 12.04) \
    --label precise64
  1. tag and match:
root@razor:/opt/razor# razor tag add -n virtualbox_vm -t virtualbox_vm

 Name =>  virtualbox_vm
 Tags =>  virtualbox_vm
 UUID =>  6kxp71t9ZT49WzCBTupT0g
 Matcher =>  <none>

root@razor:/opt/razor# razor tag 6kxp71t9ZT49WzCBTupT0g matcher add --key productname --compare equal --value virtualbox
Tag Matcher created:
 Key =>  productname
 Compare =>  equal
 Value =>  virtualbox
 Inverse =>  false
 UUID =>  7iZPfOkW0WZ8H4cpH2VEZi
  1. add the broker (there are Chef and Puppet brokers right now):
  razor broker add \
    --plugin chef \
    --name lab_chef \
    --description "Sample Chef broker"

answering several questions, pasting the validator, …, ending up with something akin to this

root@razor:/opt/razor# razor broker get all
Broker Targets:
 Name =>  lab_chef
 Description =>  Sample
 Plugin =>  chef
 UUID =>  2dz32oGbbIG44LD9ktU44U
 Chef Server URL =>  https://chef.razornet.local
 Chef Version =>  11.4.0
 Validation Key MD5 Hash =>  3079756ab27f4bfbc9a3c868b023be08
 Validation Client Name =>  chef-validator
 Bootstrap Environment =>  _default
 Install Sh Url =>  http://opscode.com/chef/install.sh
 Chef Client Path =>  chef-client
 Base Run List =>
  1. add a policy using the linux_deploy template, any label (“precise_chef”), the model to use, a tag to match and the broker UUID:
root@razor:/opt/razor# razor policy add -p linux_deploy -l precise_chef -m 3wboW0BeHJnjpniMLrAVgU -t virtualbox_vm -e true -b 2dz32oGbbIG44LD9ktU44U
Policy created
 UUID =>  32l6GNsc6eCjd3h7WQyTHK
 Line Number =>  0
 Label =>  precise_chef
 Enabled =>  true
 Template =>  linux_deploy
 Description =>  Policy for deploying a Linux-based operating system.
 Tags =>  [virtualbox_vm]
 Model Label =>  precise64
 Broker Target =>  lab_chef
 Currently Bound =>  0
 Maximum Bound =>  0
 Bound Counter =>  0
  1. use razor active-model logview to see how things work out (badly in this example, the chef server was not reachable using this hostname):
root@razor:/opt/razor# razor active_model logview
All Active Model Logs:
         State                   Action                     Result                 Time     Last     Total             Node
init                      mk_call               n/a                              15:34:32  0 sec    0 sec     5EZJuoQwwgP8FEMNLsewUw
init                      boot_call             Starting Ubuntu model install    15:34:56  24 sec   24 sec    5EZJuoQwwgP8FEMNLsewUw
init                      preseed_file          Replied with preseed file        15:35:38  42 sec   1.1 min   5EZJuoQwwgP8FEMNLsewUw
init=>preinstall          preseed_start         Acknowledged preseed read        15:35:39  1 sec    1.1 min   5EZJuoQwwgP8FEMNLsewUw
preinstall=>postinstall   preseed_end           Acknowledged preseed end         15:43:44  8.1 min  9.2 min   5EZJuoQwwgP8FEMNLsewUw
postinstall               postinstall_inject    n/a                              15:43:46  2 sec    9.2 min   5EZJuoQwwgP8FEMNLsewUw
postinstall               boot_call             Replied with os boot script      15:44:09  23 sec   9.6 min   5EZJuoQwwgP8FEMNLsewUw
postinstall               set_hostname_ok       n/a                              15:44:26  17 sec   9.9 min   5EZJuoQwwgP8FEMNLsewUw
postinstall               sources_fix           n/a                              15:44:27  1 sec    9.9 min   5EZJuoQwwgP8FEMNLsewUw
postinstall               apt_update_ok         n/a                              15:44:54  27 sec   10.4 min  5EZJuoQwwgP8FEMNLsewUw
postinstall               apt_upgrade_ok        n/a                              15:45:51  57 sec   11.3 min  5EZJuoQwwgP8FEMNLsewUw
postinstall               apt_install_ok        n/a                              15:46:16  25 sec   11.7 min  5EZJuoQwwgP8FEMNLsewUw
postinstall               os_boot               n/a                              15:46:17  1 sec    11.8 min  5EZJuoQwwgP8FEMNLsewUw
postinstall=>os_complete  os_final              Replied with os complete script  15:46:18  1 sec    11.8 min  5EZJuoQwwgP8FEMNLsewUw
os_complete=>broker_fail  broker_agent_handoff  n/a                              15:46:41  23 sec   12.2 min  5EZJuoQwwgP8FEMNLsewUw

and check /tmp/ on the machine for further logs.

Blog Posts

Interested in Cloud or Chef Trainings? Have a look at our Commandemy Trainings page. Need help migrating to the cloud? Check out Infralovers.

comments powered by Disqus
Blog Tags