VMware Cloud Community
bolsen
Enthusiast
Enthusiast
Jump to solution

Is it possible to get the total number of VMs at a given point in time?

Is there a command that will give me the total number of VMs (within the datacenter) at a given point in time? Say I want to know how many VMs we had 6 months ago and compare it to today. Is this possible?

0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

Sorry, it should read get-datacenter X | get-vm | measure-object.

View solution in original post

0 Kudos
3 Replies
admin
Immortal
Immortal
Jump to solution

Is there a command that will give me the total number of VMs (within the datacenter) at a given point in time? Say I want to know how many VMs we had 6 months ago and compare it to today. Is this possible?

You can use the measure-object cmdlet, for example

get-datacenter mydatacenter | measure-object

. You can also use get-vmhost, get-resourcepool, etc.

The number of VMs is not tracked by VC or ESX, so unless you've got that in another database you probably won't be able to figure historical values out.

sepeck
Contributor
Contributor
Jump to solution

That returns 1 for me... the number of datacenters. To get a count of the virtual servers on a datacenter you could do something like

(Get-Datacenter Name | get-vm).count

This does not get around the request for historical data to compare. For that, you'd have to run the command at regular intervals and track it.

Steven Peck

0 Kudos
admin
Immortal
Immortal
Jump to solution

Sorry, it should read get-datacenter X | get-vm | measure-object.

0 Kudos