How to integrate vRealize Automation 7 with Chef

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.

To give you an idea of how this will look when we are done

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

  1. go to design view,
  2. then packagae
  3. 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

  1. Change to Run View
  2. Change to the Workflow tab
  3. Dig down to the EBS-ChefLinuxRoleRun

Now we need to run a workflow to create the property group for the blueprint custom properties

  1. Browse to the “Create Property Group for ChefEBS Workflows” and right click
  2. 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

  1. Click the administration Tab
  2. Click Property Dictionary
  3. Click property definition
  4. Highlight the ChefLinuxProperties and click Edit

Verify that the org name property matches your default org name on your chef server then click cancel

Now let’s create a dynamic drop down list for our chef roles

  1. Click Property Definitions
  2. Click +New

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.

Update the org name property with the name of your default org on your Chef server and click OK

Now click OK to save this Property Definition

Now let’s add these to our Chef_Linux Blueprint

  1. Click the design tab
  2. Click Blueprints
  3. Highlight your Chef_Linux blueprint and click edit

Add the ChefLinux property group

  1. Select the CentOS6 Machine
  2. Click Properties
  3. Click +Add and select the ChefLinuxProperties

Add the property dictionary we created earlier

  1. Click custom properties
  2. Click edit
  3. Select the chef.role from the drop down list
  4. click show in request
  5. click ok
  6. Click Finish

Now let’s create the event subscription that will fire off our vRO workflow when we provision this new VM.

  1. Click Administration
  2. Click Events
  3. Click Subscriptions
  4. Click +New

Select machine provisioning then click next

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

Choose the workflow we installed into vRO earlier and click next

Click Finish

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.

Once provisioning is complete check the items view for the host name

Now check the Chef Server to verify everything worked

Enjoy using Chef and vRA 7 together!

Remember sharing is caring!

3 Replies to “How to integrate vRealize Automation 7 with Chef”

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

  2. 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!

  3. 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.

Leave a 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.