• Preetam Zare

Using VCO (vRO) to drive automation for vRA (vCAC) using Custom Properties

This post in many ways a repetition of Post1, Post2 and Post3. This post is about achieving same thing using new ways. When I did these posts I was unaware of this method. It took me quite long to get along. There are few basic steps you must complete before you can use this post. There are good number blogs which are covering it.  vCAC Plug for vCO was introduced sometime back and it made thing simpler further to make vRA and vRO talk with each other. Initial steps are very well covered here. By my own admission it is pretty simple to do it. It is pre-requisite before you read below post. As you might have read my previous posts, my aim was to give user choice in selecting Size of VM in T-Shirt Size style e.g. Large, Medium and Small. In previous posts I have used Advanced designer and vRO (that time VCO) can only accept string inputs. With vCAC plugin that is no longer needed.

Below is my workflow which I’m going to explain in much detailed for clarity purpose

1) First let’s discuss what are the inputs. Refer screen below. We have three inputs

VMName of type VC:VirtualMachine, vCACHost of type vCAC:vCACHost and vCACVirtualMachine of type vCAC:VirtualMachine

Except VC:VirtualMachine, all other object types are new and part of vCAC plugin. Please make a note of it. Another thing to note I no longer need to pass string. These three inputs are going to be input from vCAC.

2) Lets see what attributes I have defined

All attributes you see are part of in-built workflow. I have defined two attributed of types numbers to capture vCPU and vRAM.

Let’s see what is under script section. Below code pulls all custom properties available and part of vCAC Virtual Machine.

var vCACMachineEntity = vCACVirtualMachine.getEntity();
var vCACMachineEntityProperties = vCACMachineEntity.getLink(vCACHost,"VirtualMachineProperties");
var vCACVmProperties = new Properties();

for each (var vCACMachineEntityProperty in vCACMachineEntityProperties) {

var keys = vCACVmProperties.keys;

for each (var key in keys) {
// System.log("Key: " + key + " Value: " + vCACVmProperties.get(key));

else if (vCACVmProperties.get(key)=="Medium"){

else if (vCACVmProperties.get(key)=="Small"){

Line 1-7 we are querying vCAC Virtualmachine to get its custom property. Once we have custom property we are looking for a property name “VirtualMachine.Size” (line 14). This is a custom property defined by me. I am requesting user input against this property. I have restricted the user input to Large, Medium and Small.  I’m querying for what user has entered using vCACVmProperties.get(key)==”Large”) at line 15,20 and 26 using if else loop.Here is how it is going to look for the end user.

And I have defined VirtualMachine.Size in custom property using property dictionary.

So user selects VM size, I capture it under VirtualMachine.Size. VRO workflow will query custom property and initialized vCPU and vRAM. All the inputs we have defined as being used by this scripts section.

Now we finished Script section, next workflow item is vim3WaitToolsStarted. We need to check VMware tool is up and running. After we get confirmation on it, we can initiate graceful VM shutdown

Now next workflow item is “Shut down guest OS and wait”, This is pretty much shutdown’s VM gracefully. It needs only one input that is VM

Now next workflow item are action item changeVMvCPU & changeVMRAM. Both these action item has inbuilt reconfig task (referred as VC:Task) which is output for both the workflow

This task waits for previous task to complete or there will be conflict between the tasks

Final task is Start virtual machine and wait. This is inbuilt workflow. It needs just VM as input.


You can define your own properties in vRA and can use to carry out your own function. e.g. CMDB function or integrating with 3rd system. This feature is available a year now but it is not being heavily used by Cloud Administrator. My aim is to educate them and start using it to bring agility. Hope you like the post.

Share this:

  1. Facebook

  2. LinkedIn

  3. Twitter

  4. WhatsApp

  5. Reddit

#vCAC60 #vCloudAutomationCenter60 #vRA #vRealizeOrchestrator #vCenterOrchestrator #vCloudAutomationCenter #vRealizeAutomation


©2019 by virtual2Cloud. Proudly created with