How to get the PoweredOn VM count in Vmware using the VI Java SDK? Is there a way to filter the VMs based on the power state? The following code gives the VMs reference objects. ManagedEntity[] vms = new InventoryNavigator(clusterEntity).searchManagedEntities("VirtualMachine"); To filter the PoweredOn state VMs, we have to loop through the managed entities and retrieve the VM object, which is a time-consuming operation. Hence is there a way to get the count information alone?