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.
Log into the Razor Server as root:
vagrant ssh razor sudo su -
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 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: example.com) default: localdomain (QUIT to cancel) > cook.book 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: https://Chef.example.com:4000) (QUIT to cancel) > https://Chef.cook.book 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) > -----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEA1EMFXoQGRRgRTgu6N8lhwO1ygWwsMW92hfzE2Vcb1o/q3dEr … -----END RSA PRIVATE KEY----- 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: https://mirror.example.com/install.sh) default: https://opscode.com/chef/install.sh (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 => https://Chef.cook.book Chef Version => 11.4.4 Validation Key MD5 Hash => 55822d1a3ef564a66112f91041251690 Validation Client Name => chef-validator Bootstrap Environment => openstack Install Sh Url => https://opscode.com/chef/install.sh 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
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.
OPENSTACK SAMPLE RESUMES
OPENSTACK INTERVIEW QUESTIONS
Free Demo for Corporate & Online Trainings.