[Engine-devel] How to get the number of all running VMs

Michael Pasternak mpastern at redhat.com
Mon May 27 15:47:16 UTC 2013


On 05/27/2013 06:35 PM, Michael Pasternak wrote:
> On 05/27/2013 04:35 PM, Edgar wrote:
>> Hi All,
>>  I need to get the number of All running VMs of the oVirt-engine.
>>  My thought is first get all hosts with "up" status and then traverse each host and count the 
>>  VM with state "Running" .
> 
> you can use ovirt-shell (3.3+) for this, just run 'summary' command:
> 
> [oVirt shell (connected)]# summary
> 
> hosts-active          : 0
> hosts-total           : 0
> storage_domains-active: 0
> storage_domains-total : 0
> users-active          : 1
> users-total           : 1
> vms-active            : 0
> vms-total             : 3

btw, you can script it (see [1]), just do 'summary | grep vms-active'

[1] http://www.ovirt.org/CLI#Scripting

> 
>>
>>   Does this method feasible,and is there any easier way to count the running VMs of oVirt-engine?
>>
>>  Best Regards
>>
>>   
>>
>>  
>>
>>
>>
>>
>> _______________________________________________
>> Engine-devel mailing list
>> Engine-devel at ovirt.org
>> http://lists.ovirt.org/mailman/listinfo/engine-devel
>>
> 
> 


-- 

Michael Pasternak
RedHat, ENG-Virtualization R&D



More information about the Devel mailing list