How to get vcac host using vro


get vcacHost


// catch first match
var vcacHost = Server.findAllForType("vCAC:VCACHost")[0];
System.log("vcacHost found by type: "+vcacHost.displayName);
// vcacHost = null;



// input var: vcacVm
var vcacHost = Server.findForType("vCAC:VCACHost", vcacVm.getEntity().hostId); 
System.log("vcacHost found by vcacVm: "+vcacHost.displayName);
// vcacHost = null;

// input var: vcacVm
var vcacHost = Server.findForType("vCAC:VCACHost", vcacVm.getEntity().hostId); 
System.log("vcacHost found by vcacVm: "+vcacHost.displayName);

// vcacHost = null;

Comments

Popular posts from this blog

Creating Snapshots for Unmanaged VMs in Aria Automation (vRealize Automation)

Bulk import security policies into Palo Alto Networks firewalls

Automating Tag Creation & Assignment to VMs with vRA + vRO