vCloud Automation Center 6.0 and vCenter Orchestrator Advance Automation -Part03

Part1, Part2 are simple in some ways & parts. Next part is bit difficult to understand. At least it was for me. I will explain what I’m going to do at high level. I’ll get Machine Name. Then I will get Machine Property –> Machine Property will give me custom property ( VM Size which  user be selecting from drop down menu as referred here and Backup Selection referred here ) finally I will Invoke VCO workflow.  In this workflow which needs VM Name input and VM Size, Backup Choice as input – I will put VM Name which I get from Get Machine Name property and VM Size, Backup choice which I got from Get Machine Property


Now lets find where to do this and how to do this. Once you understand the basic concept it is way too simple. First open vCAC designer. In that first select load and then select “WFStubMachineProvisioned”. Why “WFStubMachineProvisioned”. Well, this workflow is called immediately when the status of VM is provisioned. More information is available in guide




In below screen double click on “Machine Provisioned


Scroll down till you find custom code and double click on the custom code


From left hand side “DynamicOps.Cdk.Activities” Drag “GetMachineName



I have defined two variable for this custom code

  1. vmname (to capture VM Name)
  2. VMSize (to capture VM size e.g. Large, Medium and Small in string format)
  3. VarBackupOption (To capture user selection Yes/No in string format)


Double click on GetMachineName


In Machine Id field put a pre-defined variable “VirtualMachineId”. This is standard value. Please do not change it. Under machine name put the variable vmname. This variable we have defined above.

Machine Name will pickup name from virtualmachineid and pass it to vmname. Finally variable vmname will hold the name of the vm. We are done with GetMachineName.

Click on the custom code as shown in above figure, it will take you back to custom code screen. Now from left hand side ”DynamicOps.Cdk.Activities” Drag “GetMachineProperty


GetMachineProperty reads the custom property you have defined and the value associated with that property in vCAC. In our case I have defined custom property with name VMSize and it’s value will come from value select from drop down menu. This value (e.g. Large, Medium or Small) will be taken by variable VMSize


You will notice VMSize property name is in Quotes however Property Value is without quotes. It is because VMSize in property value is variable which will be captured from user interaction in vCAC and VMSize in property name is coming from custom property defined in vCAC.

Conceptually this is how it is related



I repeated the same procedure for Backup choice and here is how it looks below


VarBackupOption will hold the user selection string value which would be either Yes or No and pass it to vCO workflow

Now we have Virtual machine name captured in VMName variable, VMSize captured in VMSize variable and BackupOption capture in VarBackupOption we are ready for next drag and drop Smile . Drag vCO workflow by name InvokeVcoWorkflow

Simply put VMName and VMSize as input to VCO workflow.



Now below is how entire workflow looks like


Now you are done with, simple Send and that updates the WFStubMachineProvisioned


This is all you need to do. Request Virtual Machine and you will get what you have configured.

Complete log of VM provisioning via vCAC and VCO is presented below with sequence of action.



Adding Backup vNetwork card in Bulk using vCenter Orchestrator

Last week I was given task to create a vCO workflow which will allow L1 sysadmins to add a network card to all VMs. I was arguing why not use Powershell? Powershell script was ready in minutes. IT manager was not comfortable with script as his experience were not good in the past and above all this task must be done by L1 during non-business hours. It should be easily executed by them.

I did took his point where in Level-1 won’t have sufficient knowledge to troubleshoot or understand the powershell script. But my point was workflow will take some time as I didn’t saw any built in workflow for it.

I started to search a better way to do it. simplest way was to use Onyx. Onyx didn’t  proved much of help here. Script given by Onyx is not at all workable. I spent lot of my time in understanding it. And some Google search. It wasn’t easy for me.

I took a powershell out from Onyx and started working on it. It gave me fare bit of idea how it should be achieved.


I have designed Workflow which could be seen above. In the workflow I first searched all the VMs in particular resource pool. You can search in the Custer, folder or other places. After I got the VMs, I have to add them network card. Since I’m expected to get more than one VM, I get all VMs in an array. To go through each VM, I used foreach loop.That is all.

User interface below only asks Level –I to select resource pool. Inside the resource pool all VMs will be added with additional network card.


In my case I selected TESTVMs resource pool as seen below


Press Submit and Booom, network cards are attached as seen below


Let me explain you the script. If you don’t read my comments go to the bottom of this post to download the script.

var managedObject = VM;<- VM is Virtual machine to which you wish to add network card
var spec = new VcVirtualMachineConfigSpec();<- You need to initialized virtual machine configuration spec
var myDeviceChange = new Array(); <- you also need to initialized a array to hold all changes.
var myVirtualMachineNICCard = new VcVirtualE1000(); <- you need to initialized  VcVirtualE1000 network card and below you fill all the required values
var configSpec = new VcVirtualDeviceConfigSpec(); <- initialized virtual machine device configuration specification

myVirtualMachineNICCard.key = 0;
myVirtualMachineNICCard.backing = new VcVirtualEthernetCardNetworkBackingInfo();
<- initialized virtual machine network backing information
myVirtualMachineNICCard.backing.deviceName = “VM Network”;
myVirtualMachineNICCard.connectable = new VcVirtualDeviceConnectInfo();
<- initialized virtual machine connectable information
myVirtualMachineNICCard.connectable.startConnected = true;
myVirtualMachineNICCard.connectable.allowGuestControl = true;
myVirtualMachineNICCard.connectable.connected = true;
myVirtualMachineNICCard.addressType = “generated”;
myVirtualMachineNICCard.wakeOnLanEnabled = true;
configSpec.operation = VcVirtualDeviceConfigSpecOperation.add;
<-since we want to add the network card, we use add
configSpec.device = myVirtualMachineNICCard
spec.deviceChange = myDeviceChange

Script is the most difficult part for this post. I tried my best to explain it. Hope it helps you all.

I also took opportunity to update my previous post and now workflow looks as shown below. User gets option to select backup network. In order to implement it I used decision workflow. If user has selected Backup Network required as Yes, then green line will be followed where network card will be added and next workflow will be executed. If he says No, add backup network workflow is skipped and next workflow is followed.



Hope it helps.

Anyone want to use or modify this script can download it from here.

And modified workflow can be downloaded from here

How to use vCenter Orchestrator to reduce your template maintenance overhead

When I choose to blog about this workflow I was bit hesitant if it is going to be really any value add to my readers. This is the extension of previous blog and it related to custom property post which I had done earlier. In custom property I raised the concern that with clone workflow you have very limited choice. As I explore in depth about integrating vCenter Orchestrator and vCenter Cloud Automation Center I found a better way to do. Clone workflow is the best workflow but vCloud Automation Center by default provides a limited customization it. I have not inclination to get into deploy mechanism of each and every OS e.g. WIM or any other method. So any thing extra I can do with cloning will be always a value add. In this post I explore this pain point.

You must have had heard VM sprawl. Have you heard of Gold templates sprawl. I have experienced it a lot. We created as many VM template as we had service type and again for each OS. Currently our VM sizing looks like below


There are total nine templates I have to maintain. Maintenance includes patching these VMs every time new patches are released. This is very common problem with MS OS. Upgrading VM tools, Upgrade VM hardware. If either of this is left it created huge incompliance in VM hardware, vmware tools and patches.

We always have searched a better solution for this. One was to use PowerShell but it was really clumsy and support was not using it at all.

Using this post I also wish to focused on resolving this problem.

Support wanted a complete automated method where in either end user (non-IT) provision the VM and he gets the VM as per the size he has selected or IT provision them

So they were looking for end to end automatic provisioning a VM without any additional effort to customize the existing deployment method. Cloning was the only option. So I felt cloning existing VM and changing the CPU, Memory and Disk size would be the best way to resolve it. vCenter Orchestrator is wonderful product. It just helps you do it without any effort as long as you know the tips and tricks about it.

All the Workflows are in-built in vCO. All I did is put them in right place.


Crux of this entire workflow is script section.


Script section is very simple. Let me explain it you

First I created a input parameter by name VMService. I have added property to it with pre-defined answers Large, Medium and Small. This create a drop down menu where user selects VM size

Second I created three attributes by name. Remember attributes gets there value from somewhere else

  1. vmNbOfCpus (type number)
  2. vmMemorySize (type number)
  3. AdditionalDisk (type number)

I used “If else” loop. So when user select VMService as Large, script under curly bracket will be executed i.e. it is take value for vCPU=4, MemorySize=4096MB and Disk size=40 GB. All I have to pass these values to next workflow. In this case they are

  1. ChangeCPUcount gets vmNbOfCpus  as 4
  2. ChangeRAM gets vmMemorySize as 4096 MB
  3. Add Data disk gets 40 GB
  4. Change the custom attribute

End User gets below screen to provision VM. Just select IP address, VM Name and Size of the VM. That is all end user has to worry. VM will be ready within 15-20 minutes.


Below is the example of workflow logs


And Below is the example of VM which was created.


As part of workflow I also added custom attribute to VM based on the size created. VM size provisioned below is Medium.


This has been achieved using vCenter Orchestrator Video training available freely at this location.

If you wish to integrate this workflow with vCloud Automation Center you should use advance workflow designer feature. I have discussed it here. Process is more or less similar.

Note: In cloning workflow vim3WaitDnsNameInTools was behaving abnormally. This action element reads DNS name of the VM. Once it read DNS name of the VM using VMware tools, it takes this as trigger to end sysprep operation and proceed next workflow. In my case I got quite varying results. While searching a bit I came across new plug-in introduced for vCenter 5.5.1. Please use latest plug-in which is right now under Technical Preview as I post this.

Integrating vCenter Orchestrator with vCloud Automation Center–Advance Service Design

In the Last post we saw how to use vCenter Orchestrator (vCO) to create service based VM. In this post we will look at how to import the vCenter Orchestrator workflow into the vCloud Automation center (vCAC). Integration process is straight provided as long as you know some unknown bugs or workarounds. To do this we have to use Advanced Service Designer. Once integration is done we can publish vCenter Orchestrator workflow as catalog items, include them in the services and publish the services in the catalog.

Little Background Information

vCenter orchestrator comes embedded with vCAC appliance.


If you use embedded vCenter orchestrator (referred as default orchestrator server) and also if you use identity appliance, vCenter Orchestrator will register itself with Identity appliance. As result vCenter orchestrator can be accessed only using SSO user i.e. administrator@vsphere.local. If you try to register the vCenter orchestrator with vCenter SSO or LDAP, vCenter orchestrator breaks. It keeps saying “Node is not active”. I don’t know yet what is the solution for this.

I simply removed identity appliance and started using SSO the one which comes with vCenter. As a result we have one SSO. vCenter orchestrator register itself to vCenter’s SSO and I can access vCO using any domain account. However if you wish to register this vCenter Orchestrator via vCAC it doesn’t work. It works only if external vCO is register using LDAP rather SSO as shown below.


Primary reason I want to highlight as I have spent almost a week on this problem and I have built vCAC environment twice. Hope it saves my reader’s time .

Lets go back to the main topic. Lets make vCenter Orchestrator vCO talk to each other.

Now we have made the connection. Next steps are simpler. Foundation is already created in the last post. All we need to do make vCAC aware of it.

Configure External vCenter Orchestrator

I preferred using external vCenter Orchestrator as it gives more flexibility in operating and managing than the embedded and looks more stable. Go to Administration Tab using Tenant Administration credentials

1. Select Server Configuration

2. Select Radio Button “Use an external Orchestrator server

3. Field details are explained below.


Most of the screen of vCloud Automation Center Provides test option. It makes things really helpful to troubleshoot. Above Test Connection button confirms if the connection is made or not. After testing connection don’t forget to press Update

As vCloud Automation Center Administrator you also have option to configure each tenant to specific folder insider vCenter Orchestrator. This is simplest way to achieve multi-tenancy inside vCAC but it still leaves you exposed at vCenter Orchestrator level.

Login as administrator to default tenant which is vsphere.local. Go to Advanced Services select Default Orchestrator Folder and edit the path as shown in screen next to below this screen


In below screen I’m selecting path for Coca-Cola Tenant. In below screen tree structured is actually being exposed by vCenter Orchestrator. Therefore folders you see below are pre-created by me.


In above screen you also see Server Configuration tab. In this tab have option to configure vCenter Orchestrator for all tenants. I have not used this.

Now lets create a custom resource

Create Custom Resources

Login with a user who has privileges of service architect. In the Advanced Services tab go to the Custom Resources tab and select the Inventory type . These inventory type are vCenter Orchestrator Objects exposed through the API of vCenter Orchestrator connection we just established above


Give Name to this inventory type. This is something you should be able to relate. This name will be needed during Service Blueprints configuration as resource you will be provisioning.


In the Details Form tab I haven’t touched anything, just left it default. Below is the screen for reference.


Service blueprints

Service blueprints allow us to publish vCenter Orchestrator workflows (pre-defined or customized) as catalog items.


Next screen you see vCenter Orchestrator’s tree structure of workflow. Select the workflow of your choice. Since I have created customized workflow in previous post, I’ve selected Coca Cola Services


On the right hand side of above screen you get to see all the parameter we have defined in the workflow. You can rename the parameter. In above screen VMName01 doesn’t make complete sense, so I will rename it as we proceed. Review and then select Next. In the Details tab put the name for the service and put some meaningful description as it presented to the customer when you request service as shown by arrow . See below how Description is reflected in catalog request form


In below screen in Blueprint form tab you’ve lot of option. e.g. you can change the order of tab. Simply drag and drop as per your requirement.


In each display items like Services, VMName01 and Backup you have ability to control default values, select whether value is required. Simply select Edit button to make modifications. Let me change the name of VMName01.


You also see Constraints tab in above figure. Below is the Constraints screen. All values are picked from the workflow e.g. I have kept VM Name to be have minimum length of string as 5.


You can change these values as per your requirement. In request form I have shown that error control is invoked when the length of string is less than 5


After Blueprint Form tab is filled, press Next in Provisioned Resource tab select the custom resource we have created earlier.


Press Add to create Service Blueprint. After Service Blueprint is created it is in draft stage. You must publish so that this is available as a catalog item while creating service.


Creating services is explained in depth in my previous posts here and here . Follow all steps in those two articles, you will be ready with service.

Login as user and select the service to be published


Fill in the details as requested below.


Press Next to go to Step tab.

Select Name of the Virtual Machine

Select Services

Select if you need Backup ( I selected Yes)


After the service is successfully provisioned, in vCenter we can see HR-Gold-009 is provisioned as expected


Conclusion: If you know vCO and vCAC I think you can do wonderful orchestration that too without have very little development background.

I’m thankful to post of  Viktor van den Berg (VCDX121) for this post on Advance Service Designer Post-I and Post-II