Optimize listComputeVMsForPowerState so it only has to iterate through list of VMs only once