Welcome to my site. I started this site as an online archive for me and all things virtual. I kept getting requests for help around some of the more standard issues we all hit in dealing with Cloud automation, particularly around the VMware vCloud Stack so I decided to make my forum public...and here we are.

My name is Lee Friend and I'm based in London, UK. I am a Cloud orchestration specialist in the end to end management, automation and integration of virtualisation stacks covering all pieces of the puzzle from IPAM (InfoBlox / QIP / IP Control), DNS, AD, resiliency & DR (SRM automation), management system integration (including ServiceNow, BMC Remedy, ticketing systems) and on and on.

Having worked since the very early days of virtualisation, I specialise in the vRealize suite (vRO,vRA,vCD,vR OPs,vCloudClient,SRM,and on) with the aim of orchestrating wherever it's needed. I have helped out large financials, global exchanges and cloud service providers at an architecture level all the way through to workflow engineering.

vRA get vSphere VM from vCAC VM

Things to do with vCAC and vRA
Site Admin
Posts: 30
Joined: Sat Dec 20, 2014 4:45 pm

vRA get vSphere VM from vCAC VM

Postby leefriend » Tue Dec 01, 2015 2:39 pm

Often the need arises to interact with a vRA VM through the vSphere layer. This code finds the vSphere VM from the vCAC VM object.

Input parameters:
- vCACVm type vCAC:VirtualMachine

Output parameters:
- vSphereVm type VC:VirtualMachine

Code: Select all

var sdkConnections = VcPlugin.allSdkConnections;
for(var i in sdkConnections){
    var host = sdkConnections[i];
    // this uses contains in the xpath - in individual cases it might require more specific xpath criteria
    var vSphereVms = host.getAllVirtualMachines(null, "xpath:contains(name, '" + vCACVm.getEntity().getProperty("VirtualMachineName") + "')");
    // example assumes only 1 VM will be found
    vSphereVm = vSphereVms[0];

Return to “Everything vCAC / vRA”