With the following vRO script lines, I would be able to get the server vms entities. However, this is not working to get workstation (windows7 & 10 etc) entities?
var vCACVms = Server.findAllForType("vCAC:VirtualMachine", "VirtualMachineName eq '" + vmName + "'");
var virtualMachineEntity = vCACVms[0].getEntity();
var vCacHost = Server.findForType("vCAC:VCACHost", virtualMachineEntity.hostId);
By trying with the following way also not working. Is there a better way to get the provisioned workstation properties (details)?
var vmName = "win7ent";
var allVms = VcPlugin.getAllVirtualMachines();
for (var i in allVms) {
if (allVms[i].name == vmName) {
vm = allVms[i];
break;
}
}
var virtualMachineEntity = vm.getEntity();
var vCacHost = Server.findForType("vCAC:VCACHost", virtualMachineEntity.hostId);