Automation

 View Only
  • 1.  Problem with Get-Stat in the latest release

    Posted Jan 09, 2008 08:30 PM

    Does Get-stat not work in the latest (12/26) release?

    It seems like I used to be able to do something like this in the previous version...

    Get-Stat -Entity $myVM -Start (get-date).AddDays(-30) -CPU -Finish (get-date)

    To get the last 30 days of data, but now it seems that no matter what I do, it only gives me the last hour's worth of stats. It is almost as if it was getting stats from Virtual Center before, and now it only get's stats directly from the host.

    Does anyone else have this problem? Or better yet, a solution.

    After further experimentation it works better when I set the -MaxSamples option to a large number and the IntervalMins to a larger number e.g.

    get-stat $vm -start (get-date).AddDays(-30) -CPU -stat -cpu.usage.average -IntervalMins 60

    I thought it was supposed to default to the smallest interval possible for the data period selected.



  • 2.  RE: Problem with Get-Stat in the latest release
    Best Answer

    Posted Jan 10, 2008 05:26 PM

    The MaxSamples defaults to 10 if not otherwise specified, which is getting in the way of what you're trying to do by specifying the dates. We'll have to look at that interaction. The workaround for now as you noted is to specify a large MaxSamples.

    In your example, if you want to collect all the stats in that time range with 5-minute granularity (assuming your server is configured with a 5-minute interval - if not, the closest available one will be picked), something like this should work:

    get-stat $vm -start (get-date).AddDays(-30) -CPU -stat -cpu.usage.average -IntervalMins 5 -MaxSamples 10000

    If you don't specify the interval, it should default to 10 or whatever the closest available interval is.

    Antonio (VMware developer)