VMware Cloud Community
astrolab
Contributor
Contributor

Historical running VMs count

I was looking into creating a simple historical report of running VMs in a cluster....and I realized that there is no such counter, when running get-stattype -entity (get-cluster mycluster), I get the vmotion counts, register/unregister, poweredon/off but no running VMs. Has anyone tried to run a script to that effect?

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership

The amount of VMs, in different states, in a cluster can be found using the vmop metrics.

For example

Get-Stat -Entity (Get-Cluster MyCluster) -Stat vmop.numPowerOn.latest -MaxSamples 1


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
astrolab
Contributor
Contributor

LucD, thanks, I actually was looking at your post http://www.lucd.info/2009/12/30/powercli-vsphere-statistics-part-1-the-basics/  when trying . The vmop.numpoweron.latest reports the total number of poweron operations , not the number of running VMs at a given time, it seems.

Reply
0 Kudos
LucD
Leadership
Leadership

Yes, you are absolutely right, that is the number of powerons that occurred.

Afaik there is no metric to give you the historical number of VMs in cluster.

Sorry about the confusion.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos