I would like to get the average network throughput for a VM with PowerCLI including all virtual NICs the VM has for the last week (not including NFS or storage-related traffic).
How should I best add that to this report:
get-vm myvm | select name, numcpu
Thanks!
I see,
Thanks for the sharing and the explanation Lucd.
I got this error:
Get-Stat The metric counter "net.throughput.usage.average" doesn't exist for entity "VM-TEST01".
+ [math]::Round((G <<<< et-Stat -Entity $_ -Start (Get-Date).AddDays(-1) -Stat "net.throughput.usage.average" |
What was wrong with the script below:
Get-VM |
Select Name, @{N="Avg Network Throughput MBPs";E={
[math]::Round((Get-Stat -Entity $_ -Start (Get-Date).AddDays(-1) -Stat "net.throughput.usage.average" |
where {$_.Instance -eq ""} |
Measure-Object -Property Value -Average | Select -ExpandProperty Average)/1KB,2)
}}
I have already increased the statistics to level 3 in my VCenter last week.
You also get that message when there is no data at the point in time specified with Start.
It could be that the VM was not powered on at (Get-Date).AddDays(-1).
Do you statistical data for the VM at that point in time on the Performance tab in the Web Client?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi All,
Because too many search pointing to this page and the real trick here is "net.usage.average". A HERO already said it and worth a bump.
Thanks to OP as well.
Cheer,
Joe
LucD, seen a script out there that will dig through a vcenter, and determine network throughput by vm and list cluster its in?
No, not verbatim, but it shouldn't be that hard to set up such a script.
But may I suggest to start a new thread for that question.
There are already too many add-ons in this thread.
Also mention if you want that data for 'now' or for a period in the past.
If for a period in the past, note that there some requirements for the Statistics Level.
Note that for VMs there is only the net.usage.average metric with Statistics Level 1.
There is also net.transmitted.average and net.received.average, but they require at least Statistics Level 2
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference