• Home
  • OpenStack
  • Defining a Razor broker, model, and policy In OpenStack

Defining a Razor broker, model, and policy In OpenStack

  • (4.0)
  • | 863 Ratings

Before RAZOR does anything more than collecting information about a node, it will need to have a number of things defined. Specifically, we will define the broker, or how Razor will hand off an installed node to a Configuration Management framework (Chef), a Razor model to provide install time details like domain name and default passwords. Finally, we will create a Razor policy, which will tie the broker and model together and apply it to nodes based on their attributes, or tags.

Getting ready

Log into the Razor Server as root:

vagrant ssh razor sudo su -

How to do it…

Now that you are logged into the Razor Server, you will need to run the following commands to create the Razor model, broker, and policy needed to install a node.

To gain in-depth knowledge and be on par with practical experience, then explore  OpenStack Training course.

Adding a Razor model

To create a Razor model, execute the following commands:

root@razor:~# razor image Images
UUID => 1gsQVKIc1TpbEWPteB2sSc Type => OS Install
ISO Filename => ubuntu-12.04.2-server-amd64.iso Path => /opt/razor/image/os/1gsQVKIc1TpbEWPteB2sSc Status => Valid
OS Name => precise64 OS Version => 12.04
root@razor:~# razor model add -t ubuntu_precise -l openstack_model -i 
--- Building Model (ubuntu_precise):
Please enter node hostname prefix (will append node number) (example: node)
default: node (QUIT to cancel)
Please enter local domain name (will be used in /etc/hosts file) (example:
default: localdomain (QUIT to cancel)
Please enter root password (> 8 characters) (example: P@ssword!) default: test1234
(QUIT to cancel)
Model created
Label => openstack_model Template => linux_deploy
Description => Ubuntu Precise Model UUID => 224ITdMCkDp4lga29f4KIg
Image UUID =>      1gsQVKIc1TpbEWPteB2sSc
Adding a Razor broker

Next, we create a broker using the following commands:

# razor broker add -p chef -n openstack_broker -d "OpenStack Broker"
--- Building Broker (chef):
Please enter the URL for the Chef Server. (example:
(QUIT to cancel)
Please enter the Chef version (used in gem install). (example: 10.16.2)
(QUIT to cancel) > 11.4.4
Please enter a paste of the contents of the validation.pem file, followed by a blank line. (example: -----BEGIN RSA PRIVATE KEY-----
nMIIEpAIBAA...) (QUIT to cancel)
Please enter the validation client name. (example: myorg-validator) default: chef-validator
(QUIT to cancel)
Please enter the Chef environment in which the chef-client will run. (example: production)
default: _default (QUIT to cancel)
> cookbook
Please enter the Omnibus installer script URL. (example:
default: (QUIT to cancel)
Please enter an alternate path to the chef-client binary. (example: /usr/local/bin/chef-client)
default: chef-client (QUIT to cancel)
Please enter an optional run_list of common base roles. (example: role[base],role[another])
(SKIP to skip, QUIT to cancel) > SKIP
Name =>      openstack_broker
Description => OpenStack Plugin => chef
UUID =>      39XT0By6aFT2XzqdcD8cEQ
Chef Server URL => Chef Version => 11.4.4
Validation Key MD5 Hash => 55822d1a3ef564a66112f91041251690 Validation Client Name => chef-validator
Bootstrap Environment =>      openstack
Install Sh Url => Chef Client Path => chef-client
Base Run List =>
Adding a Razor policy

Our last step is to add a Razor policy using the following commands:

# razor policy add -p linux_deploy -l openstack_base -m  -b  -t OracleCorporation –e true
Policy created
UUID => 4IMX7WwWukSvLnEInmL5Wz Line Number => 0
Label => openstack_base Enabled => true
Template =>      linux_deploy
Description => Policy for deploying a Linux-based operating system. Tags => [OracleCorporation]
Model Label => lol Broker Target => lol Currently Bound => 0 Maximum Bound => 0 Bound Counter => 0

How it works…

Our first command “razor image” was executed to list all of the images Razor is aware of and their corresponding UUID. The UUID for the Ubuntu Precise image was used in the next command, the razor model add. During the razor model add, we supplied installation time details about our Ubuntu model.
Next, we created the Razor broker. The razor broker add command is what tells Razor where and how to hand off an installed node to a configuration management framework. While executing the command, we walk through a wizard and prompted for the URL of our CHEF SERVER, the validation.pem RSA key, as well as the Chef version to install.
Finally, we executed razor policy add to tie it all together. Specifically, we specified a “linux_deploy” policy, named it “openstack_base”, and configured it to use both the model we created earlier as well as the broker. In the tags field, as we are in a small known environment, we specified “OracleCorporation”, which will grab any VirtualBox VMs booted onto the Razor network.

Related Pages:

Sample Resume:

Interview Questions:

Subscribe For Free Demo

Free Demo for Corporate & Online Trainings. Protection Status