Dynamically updated request forms example with vRA, vRO and Chef

I often hear customers request a way to dynamically update a vRA request form when a change is made in a 3rd party system. For example, when the Chef admin adds or removes roles from the Chef server, they would like a way to automatically update a drop down list that is presented in vRA at request time. You may have read my previous blog posts on How to create self service portal with vRA and Chef. In those guides I create a drop down list where the requester could choose the Role they want applied to the new VM when it is built. This list can become stale our outdated quickly if the vRA admin does not constantly look at what roles changed in Chef and update it manually. That is why I have created this guide and attached workflow to automate this process. Update: See my guide here for vRA7.

media_1428363164180.jpg

Change Log

v1.0

  • Initial release

Credits

Dan Linsley @danlinsley for creating the Chef and Custom Property workflows for vCO.

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
  • vRA with Chef extension installed and one blueprint configured Guide here
  • RHEL/CENTOS 6 Blueprint in vRA with VMtools installed and Chef Client with the starter kit from hosted Chef
  • Chef Workflows Package installed and configured See Here
  • vCAC Custom Properties Package see here
  • a quite place where you will not be interrupted

Installation

At this point you should have a working Blueprint published to the vRA catalog. Now we need to install and configure the workflow I created. Download and unzip the workflow above. Now login to the vRO client and change to Administer view then click to import the package.

media_1428365412516.jpg

Now change to run and browse to the VMtocloud folder and the vRAvCACChefRoleSync workflow and click edit

media_1428366008543.jpg

Go to the general tab, here you will need to select the vRA IaaS server then update the propertyDefinitionName and the name of the attribute that contains the drop down role list then save and close the workflow.

media_1428366290001.jpg

Now run the workflow and provide the chefhostname, userid and orgname

media_1428366410539.png

You should see a green check indicating the workflow ran.

media_1428366464877.png

Now let’s login to the vRA portal and see what this workflow is actually doing. Navigate to the Infrastructure tab then blueprints, then property dictionary then click to edit property attributes of the Chef.Role Property Definition

media_1428366683090.jpg

Notice that currently the only role is lampstack

media_1428366738128.png

Now login to your Chef Server and go to policy tab then roles. Notice the only role is lampstack

media_1428366785400.png

Now add a new role vratest. This does not have to be a real role this is just to test. You should now have two roles like shown.

media_1428366895239.png

Now go back to the vRO client and run the workflow again.

media_1428366945793.jpg

Now go back to vRA and check that Property attribute list. NOTE you may need to refresh your browser to see the change.

media_1428367078237.jpg

Now you will need to go back to vRO client and schedule the workflow to run periodically, every day or every hour depending how often you update chef roles.

media_1428367203383.png

The end result is every time a user requests a VM with Chef integration the roles in the drop down list reflects what is actually available on the Chef server.

media_1428367623642.png

Enjoy!

Remember, sharing is caring ->Tweet about this on Twitter
Twitter
Share on Facebook
Facebook
0Share on LinkedIn
Linkedin
Email this to someone
email

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.