Hi,
I have a workflow to find out how many VM's are in poweredOff state. VC has more than 7000 VM's and the workflow takes lot of time to produce the result as it has to loop through each of these 7000 VM's to find those VM's which are in powered off state.
So just wondering if there is any other way to achieve the result much quicker.
var vms = VcPlugin.getAllVirtualMachines() var poffvms = 0 for each (vm in vms){ if (vm.runtime.powerState.value == "poweredOff"){ poffvms = poffvms + 1 } } System.log(poffvms);