HI Luc ,
can yu suggest on the following requirement?
need to create report where cpu utilization of vms is less than 8 percent for last one month .
do i need to enable stat level 3 for this on vcenter ??
You could do that, but why, the cpu.usage.average metric returns the percentage directly.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
also
below is what gives avarage value but i need percentage is there any direct property for percentage also similar to
cpu.usagemhz.average
Get-VM | Where {$_.PowerState -eq "PoweredOn"} | Select Name,
@{N="CPU Usage (Average), Mhz" ; E={[Math]::Round((($_ | Get-Stat -Stat cpu.usagemhz.average -Start (Get-Date).AddDays(-30) -IntervalMins 5 | Measure-Object Value -Average).Average),2)}}
Export-Csv -Path c:AverageUsage.csv
If you use the cpu.usage.average metric, you will have a percentage
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
so inoder to get actual requirement of vms where cpu avg percentage is less than 8 percent for last 30 days
i need to put one more pipe of |?{$_ -le "8"}} in below .can yu please check in lab if this gives correct result.
E={[Math]::Round((($_ | Get-Stat -Stat cpu.usagemhz.average -Start (Get-Date).AddDays(-30) -IntervalMins 5 | Measure-Object Value -Average).Average),2)}}
You are still using cpu.usagemhz.average
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
am i not supposed to get rario of cpu.usagemhz.average and esxi cpu core MHZ to find cpu percentage??
You could do that, but why, the cpu.usage.average metric returns the percentage directly.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference