Hello,
I need to get all vCloud Director VMs related to a vCD Host in vRealize Orchestrator.
I already created this Script:
var adminhost = host.toAdminObject(); var AdminOrganizations = adminhost.getAdminOrganizations(); var VcloudVms = new Array(); for each (AdminOrganization in AdminOrganizations){ var AdminVdcs = AdminOrganization.getAdminVdcs(); for each (AdminVdc in AdminVdcs){ var VApps = AdminVdc.getVApps(); for each (VApp in VApps){ var Vms = VApp.getChildrenVms(); for each (Vm in Vms){ VcloudVms.push(Vm); } } } } System.log(VcloudVms.length + " vCloud Vms Found");
But I think this can´t be the most efficient way to do that... Any recommendations?
Best regards,
Markus