Is it possible to pull the CPU Ready stats on a per ESX Host basis?
The cpu.ready.summation metric is only available for virtual machines, not for ESXi hosts.
But you could work around this as follows.
$vm = Get-VMHost "esx1","esx2","esx3" | Get-VM
$metric = "cpu.ready.summation"
$start = (Get-Date).AddDays(-1) $stats = Get-Stat -Entity $vm -Stat $metric -Start $start $stats | Group-Object -Property {$_.Entity.Host.Name} | %{ New-Object PSObject -Property @{ Name = $_.Group[0].Entity.Name CpuReadyAvg = ($_.Group | Measure-Object -Property Value -Average).Average } }
The script collects the metric value for all the VMs that are hosted on the ESXi servers you want to report upon.
The ready time values for all VM running on a specific host are averaged.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The cpu.ready.summation metric is only available for virtual machines, not for ESXi hosts.
But you could work around this as follows.
$vm = Get-VMHost "esx1","esx2","esx3" | Get-VM
$metric = "cpu.ready.summation"
$start = (Get-Date).AddDays(-1) $stats = Get-Stat -Entity $vm -Stat $metric -Start $start $stats | Group-Object -Property {$_.Entity.Host.Name} | %{ New-Object PSObject -Property @{ Name = $_.Group[0].Entity.Name CpuReadyAvg = ($_.Group | Measure-Object -Property Value -Average).Average } }
The script collects the metric value for all the VMs that are hosted on the ESXi servers you want to report upon.
The ready time values for all VM running on a specific host are averaged.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Luc,
Do I have to provide the ESX host in a string array to make it work ?
No, you can also provide a single ESXi host.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'm seeing cpu.ready.summation results for ESXi 5.0 hosts with, for example,
get-vmhost hostname.domain.tld | get-stat -stat cpu.ready.summation
The performance manager documentation lists HostSystem along with VirtualMachine, as an entity for which the counter is supported:
Under 'ready' the doc says:
"For host entities, it appears to aggregate the ready times for all vms on the host."
That's exactly what happens. That being said, I don't know how useful CPU Ready at the host level can be and I'd be curious to hear how it's being used.
As fas I'm aware, CPU Ready best practices (example: <1000ms) are based upon a per-vCPU basis at the VM level. A safe threshold for a host would be a big variable depending on how many vCPUs have been allocated and it would be a moving target due to vMotion. Without too much thought behind this, to get a somewhat useable number, you may want to divide that host summation CPU Ready value by the number vCPUs allocated across all VMs on that host. But that would still only get you an average per-vCPU value, which could still be misleading but better than the raw number.
Agreed. I just noticed the counter yesterday, and was trying to make sense of it. Your suggestion seems good, so I'll start there.