PowerCLI

 View Only
  • 1.  New to Powercli, why is get-stat so slow?

    Posted May 08, 2012 01:33 PM

    I fairly new to Powercli, and am starting to delve into some statistics gathering. With nearly 1,000 vms, it is really really slow.

    For instance, a query of say "Get-VM | Get-Stat -Stat cpu.usage.average" using a start and finish of 1 day,,,could take about an hour.

    I have been reading(though do not comprehend yet) that using Get-View could seriously speed things up.

    Now I am not looking for anyone to write me a script, I am just wondering is this the time I can expect Get-Stat to run--1Hr+. Or Can I use get-view somehow to speed things up.



  • 2.  RE: New to Powercli, why is get-stat so slow?

    Posted May 08, 2012 02:00 PM

    You could optimize that statement, for example place all VMs in 1 array, do 1 call to Get-Stat and then use for example Group-Object to retrieve the results per VM.

    $vms = Get-VM

    $stats = Get-Stat -Entity $vms....

    $stats | Group-Object -Property {$_.Entity.Name}

    There's a couple of examples in my Statistics posts.

    Start with Part 1-4, they give a bit of statistics background and some general methods.



  • 3.  RE: New to Powercli, why is get-stat so slow?

    Posted May 08, 2012 02:09 PM

    Thank you very much! I will check out your posts.