VMware Cloud Community
TheVMinator
Expert
Expert
Jump to solution

Average Network throughput for a VM with PowerCLI

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!

25 Replies
AlbertWT
Virtuoso
Virtuoso
Jump to solution

I see,

Thanks for the sharing and the explanation Lucd.

/* Please feel free to provide any comments or input you may have. */
Reply
0 Kudos
AlbertWT
Virtuoso
Virtuoso
Jump to solution

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.

/* Please feel free to provide any comments or input you may have. */
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
JoeSze
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
RJ4719
Contributor
Contributor
Jump to solution

LucD, seen a script out there that will dig through a vcenter, and determine network throughput by vm and list cluster its in?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos