VMware Cloud Community
number1vspheref
Contributor
Contributor

Replicate "Report Performance..." Menu-Pick with Get-Stat (or Similar)

Hi,

I've been reading up a lot of the resources that are available on PowerCLI reporting. It seems that get-stat is the main engine behind performance statistics reporting in PowerCLI. However I am attempting to replicate the "Report Performance..." menu-pick (which is available when you right-click on a VM or host in the vSphere client) and have been unable to do this. I want to be able to export to XLS as can be done from "Report Performance..." and also specify time intervals etc. Is there any one-to-one correlation between get-stat and "Report Performance..."?

Based on what I have read to date (e.g. parts 1 to 4 of http://www.lucd.info/2009/12/30/powercli-vsphere-statistics-part-1-the-basics/ and elsewhere), get-stat requires a lot of 'massaging' e,g, output must be redirected (and possibly formatted in advance) as by default it goes to the screen.

Any thoughts on what is the easiest way to do what I am attempting via PowerCLI?

Thanks,

number1vspherefan.

0 Kudos
2 Replies
LucD
Leadership
Leadership

There is afaik no one-to-one documentation (yet) with the Report Performance option in the vSphere client and the Get-Stat cmdlet(s) to be used.

On the toher hand with the spreadsheets produced from the vSphere client and the information available on the PerformanceManager page under the Performance Counters section, it is, in my opinion, not too hard to translate the spreadsheet in a Get-Stat cmdlet and its parameters.

Let's take for example the CPU sheet from the ESX(i) server spreadsheet:

  • The Time column is obvious and corresponds with the Timestamp that is returned by Get-Stat
  • The CPU columns come from the cpu.usage.average metric
  • The Usage-0 to Usage-n columns correspond with the CPU cores on your ESX(i) host. For this you have to look at the Instance property in the objects returned by Get-Stat
  • The Usage column is the so-called aggregate value for the cpu.usage.average metric. In this case you take the value from the Instance -eq "" record.
  • The Usage in MHz column comes from the cpu.usagemhz.average metric. For this column you also take the aggregate value (Instance -eq "")

The hardest part, in my opinion, is to find the metrics you need to pass to the Get-Stat cmdlet.

I suspect explaining these spreadsheets in Get-Stat statements and how to create the XLS from the returned values would be a good 'part 5' in my Statistics series 🙂


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

number1vspheref
Contributor
Contributor

Thanks LucD .... I'll keep an eye out for Part 5 so Smiley Happy. I'm gonna try to play around with this, will post back here if I make any progress.

0 Kudos