Skip to content

Instantly share code, notes, and snippets.

@joe-speedboat
Created March 16, 2018 13:33
Show Gist options
  • Save joe-speedboat/e3335cf20fcab49887928dcb51fda841 to your computer and use it in GitHub Desktop.
Save joe-speedboat/e3335cf20fcab49887928dcb51fda841 to your computer and use it in GitHub Desktop.
vRO - SDK > vCenters > vCenter > Cluster > VM
var vCenters=VcPlugin.allSdkConnections;
for each (vCenter in vCenters){
System.log(vCenter.name);
var clusters = vCenter.getAllClusterComputeResources();
for each (cluster in clusters) {
System.log(cluster.name);
var vms = vCenter.allVirtualMachines
for each (vm in vms)
System.log(vm.name);
//do your per vm action here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment