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?
Sorry, it should read get-datacenter X | get-vm | measure-object.
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.
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
Sorry, it should read get-datacenter X | get-vm | measure-object.