Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Get all vCD VMs from vCD Host

$
0
0

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


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>