vRA/vCAC Chef Client Extension

This guide and supplied workflows will allow you to create a self service application portal using vRA/vCAC to provision VM’s and Opscode Chef to install and manage your applications. This guide and attached workflows were developed using hosted Chef but can easily be modified for open source chef. This guide is not about Chef. If you want to learn and use Chef please see https://learn.chef.io/ for a tutorial and a free hosted Chef account. This is a very basic example of how to call Chef from a provisioning process. For more advanced use cases please see the following: https://communities.vmware.com/docs/DOC-24934

media_1426707439070.png

Change Log

v1.0

  • Initial release

Pre-Reqs you need in place

  • vRA 6.2 or vCAC 6.x (vCAC 5.2 may work but I have not tested)
  • vCO extensibility installed and configured for your vRA/vCAC installation see here
  • Hosted Chef or open source Chef
  • At least one Role and one recipe created on the Chef Server
  • RHEL/CENTOS 6 Blueprint in vRA with VMtools installed and Chef Client with the starter kit from hosted Chef (This guide and workflows are implying that the starter kit is in /home/chef-repo)
  • a quite place where you will not be interrupted

Credits

Christophe Decanini @cdecanini_ and all who contributed to the Guest Script Manager Package

Installation

For this extension to work you need to be sure that you have vRO/vCO extensibility properly installed and configured, follow my guide here

Once that is done open the vRO/vCO client and install the workflow package I supplied. The file you downloaded is in a zip file. Make sure you unzip the file first before trying to import into vCO.

media_1426709114583.jpg

Login to vRO/vCO client

  1. Change to administrator view
  2. Change to the packages tab
  3. Click Import
  4. Locate the org.vmtocloud.vravcac.chef.workflows.package
  5. Click open

Follow the prompts to import the package

media_1426709290814.jpg

Once imported you will see the new workflows in your workflows list

media_1426709351293.jpg
  1. Change view to RUN
  2. Browse to the VMtocloud folder then vRAChefWorkflows

Now we need to edit the workflows to add your user and password for the Guest VM’s we will be automating

media_1426709569387.jpg
  1. Select the vRACHefRoleAdd workflow
  2. Click edit

Now edit the user and password so vRO/vCAC can access the guest and run the knife command to bootstrap the guest.

media_1426709796761.jpg
  1. Go to the general tab
  2. Modify the vmusername and vmPAssword with what you use to access the RHEL/CENTOS template you will be provisioning to.
  3. Click save and close

Repeat the above procedure if you also intend to use the ChefRecipe workflow

Now that you have the workflow installed and the user name and password configured let’s create the build profile that will call this workflow after the machine is provisioned from vRA/vCAC

First let’s copy the workflow id to the clipboard

media_1426710194208.jpg
  1. Select the vRAChefRoleAdd Workflow
  2. Highlight the ID
  3. Control C to copy to clipboard.

Now log into vRA/vCAC as administrator and go to the infrastructure tab then Blueprints, then Property dictionary and create the following property definition

media_1426710424267.jpg
  1. Chef.Role
  2. Choose Chef Role
  3. DropDownList
  4. Click Green Check Mark

Now edit the Property Attributes

media_1426710573543.jpg

Now add the following to the Property Attribute

media_1426710724596.jpg
  1. ValueList
  2. ChefRole
  3. list of roles available on your Chef server
  4. Click green check box
  5. Click OK

Change to Build Profiles tab and create the following build profile

media_1426710805506.jpg
  1. ChefRoleAdd
  2. Chef.Role
  3. CHeck yes to prompt user
  4. ExternalWFStubs.MachineProvisioned
  5. Paste that workflow ID we copied to the clipboard earlier

Change to the blueprints tab and add the new build profile to your blueprint that has the Chef Client already installed.

media_1426711046155.jpg

Go to the request portal and fire off a new request and choose the role you want to add

media_1426711160527.png

Want to make your portal sexy with Chef icons and more? Download my icon pack!

After the machine is provisioned you should see your new server registered on Chef and the new role assigned.

media_1426711275595.png

Follow the same procedure above to configure the recipe workflow. Enjoy!

Remember sharing is caring!

4 Replies to “vRA/vCAC Chef Client Extension”

    • Thanx Gary, I actually plan on incorporating some of those workflows to decommission a server node. This was just the easiest path to integrate with vRA.

  1. Pingback: Dynamically updated request forms example with vRA, vRO and Chef | VMtoCloud.com

  2. Pingback: Self Service Application Deployment with vCAC, vCO and Chef! | VMtoCloud.com

Leave a Reply to Gary Coburn Cancel reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.