As you may have noticed in vRealize Automation 7 the event broker is the new method of triggering vRealize Orchestrator workflows. Also the custom properties are now stored in the vRA appliance database so the old workflows I created to update the roles drop down do not work with the new version. The good news is that there is now a generally available Chef plug in for vRealize Orchestrator.
Disclaimer: This guide is designed as an example for educational purposes and as a building block to develop your own integration. It has not been tested in production environments.
Pre-Reqs
- vRealize Automation 7.x installed at minimum advanced edition
- vCenter Plugin for vRO Configured
- Chef Server installed and at least one org, one recipe and one role, two or more roles would be best See my blueprint here
- Chef Plugin Installed and Configured See my guide here
- One CentOS/RHEL 6 or 7 blueprint created and successfully provisioning from vRA (Be sure your Chef recipes support the version of Linux your testing)
- My Chef Workflow and Action package file downloaded from here
- A quite place where you will not be interrupted See my guide here
Let’s start by uploading the package I created to your vRO server
Open the vRO client as an administrator
- go to design view,
- then packagae
- Click Import Package
Choose the org.vmware.sdeset.vrealizeautomation.chefpluginextensions.package and click open
Click next to import the package
Check to verify the workflow is installed
- Change to Run View
- Change to the Workflow tab
- Dig down to the EBS-ChefLinuxRoleRun
Now we need to run a workflow to create the property group for the blueprint custom properties
- Browse to the “Create Property Group for ChefEBS Workflows” and right click
- Click Start Workflow
Fill out the form as shown and click submit
Notice, this guide is using Linux however the Chef Plugin also supports Windows, if you plan on using this with Windows you will need to point to a share where the Chef client MSI is. If your using linux you can just put a bogus entry there for now to statify the form, for example \\server\share
Now login to vRA portal as a cloud admin
- Click the administration Tab
- Click Property Dictionary
- Click property definition
- Highlight the ChefLinuxProperties and click Edit
Verify that the org name property matches your default org name on your chef server then click cancel
Enter the following and do not click ok until after the next two steps
Note: the name must be chef.role for this integration to work
Ok, now under values on the right click the external values radio button and the following screen will appear. Browse to the action you uploaded to vRO earlier and click OK.
Now let’s add these to our Chef_Linux Blueprint
- Click the design tab
- Click Blueprints
- Highlight your Chef_Linux blueprint and click edit
Add the ChefLinux property group
- Select the CentOS6 Machine
- Click Properties
- Click +Add and select the ChefLinuxProperties
Add the property dictionary we created earlier
- Click custom properties
- Click edit
- Select the chef.role from the drop down list
- click show in request
- click ok
- Click Finish
Now let’s create the event subscription that will fire off our vRO workflow when we provision this new VM.
- Click Administration
- Click Events
- Click Subscriptions
- Click +New
Enter the following and press next
Data> Lifecycle state> Lifecycle state name equals VMPSMasterWorkflow32.MachineProvisioned
Data> Lifecycle state> State Phase equals POST
Data> Blueprint Name equls Chef_Linux
Go to the catalog and fire off a new request
Notice the drop down list is populated with roles from your Chef server so the roles can be managed from there.
Pingback: Dynamically updated request forms example with vRA, vRO and Chef – VMtoCloud.com
Note: if you connect vRO/vRA to multiple vCenters, then the “Parse vRA EBS Machine Lifecycle Event” workflow may fail, since moRef ID’s can be similar across multiple vCenters. You will get an error that says “exception: ‘Matches more than one VM with MoRef”. If you modify the workflow to instead lookup the VM by name, UUID, or a combo of MoRef and vCenter, it will succeed.
Great blog post, thanks!
Hai. I want to
1. Automate vlans workflows using vRA
2. Create port groups in Vcenter and enabling vlans to vRA
By using chef tool.
Please help me out with screen shots.