Host Power Usage

The script below will pull a list of all of your hosts and display the real time metrics for Power Usage, CPUusage% & Memoryusage% to allow you to make changes to your power settings etc and see what impact it has on utilization for a given % of demand.

get-vmhost | Select name,
@{N=“Time“;E={$(get-date -f yyyy-MM-dd-hhmm)}},
@{N=“PowerAverage“;E={$_ | Get-stat -stat power.power.average -realtime -MaxSamples 1}},
@{N=“CPUusage%“;E={$_ | Get-stat -stat cpu.usage.average -realtime -MaxSamples 1 | Where {$_.Instance -eq “”}}},
@{N=“Memusage%“;E={$_ | Get-stat -stat mem.usage.average -realtime -MaxSamples 1}} | FT

Or you can export to csv as follows:

get-vmhost | Select name,
@{N=“Time“;E={$(get-date -f yyyy-MM-dd-hhmm)}},
@{N=“PowerAverage“;E={$_ | Get-stat -stat power.power.average -realtime -MaxSamples 1}},
@{N=“CPUusage%“;E={$_ | Get-stat -stat cpu.usage.average -realtime -MaxSamples 1 | Where {$_.Instance -eq “”}}},
@{N=“Memusage%“;E={$_ | Get-stat -stat mem.usage.average -realtime -MaxSamples 1}} | Export-csv -path “C:\Temp\CPUPowerUsage.csv” -Append

 1,619 total views,  14 views today

Leave a Reply

Your email address will not be published. Required fields are marked *