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
- 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
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.
Login to vRO/vCO client
- Change to administrator view
- Change to the packages tab
- Click Import
- Locate the org.vmtocloud.vravcac.chef.workflows.package
- Click open
Once imported you will see the new workflows in your workflows list
- Change view to RUN
- 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
- Select the vRACHefRoleAdd workflow
- Click edit
Now edit the user and password so vRO/vCAC can access the guest and run the knife command to bootstrap the guest.
- Go to the general tab
- Modify the vmusername and vmPAssword with what you use to access the RHEL/CENTOS template you will be provisioning to.
- 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
- Select the vRAChefRoleAdd Workflow
- Highlight the ID
- 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
- Choose Chef Role
- Click Green Check Mark
Change to Build Profiles tab and create the following build profile
- CHeck yes to prompt user
- 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.
Go to the request portal and fire off a new request and choose the role you want to add
Want to make your portal sexy with Chef icons and more? Download my icon pack!