Automation

 View Only
  • 1.  Get-Stat on Powered Off VM

    Posted Apr 29, 2011 06:13 PM

    I realize a powered off VM will not generate statistics, but why can't any historical data be retrieved? I am able to view the data in the "Past Day" rollup from the vSphere client, but running this:

    $VM | get-stat -stat $stat -start $start -finish $finish

    Yields no results if the VM is currently powered off. We have a script that grabs disk IO data nightly and we'll be missing data if the VM is powered off when the script runs. Is there another cmdlet or option that will allow me to grab the historical data even if the VM is off?



  • 2.  RE: Get-Stat on Powered Off VM

    Posted Apr 29, 2011 06:21 PM

    It depends on which time interval you select with the Start and Finish parameters.

    The Get-Stat cmdlet determines on these times from which Historical Interval the statistical data will come.

    Try setting the Start further back in time.



  • 3.  RE: Get-Stat on Powered Off VM

    Posted Apr 29, 2011 06:35 PM

    I did try that. I set the start and finish to the previous day (and a few days previous) but it will not return any data. Would setting the intervalSecs switch force it to pull from a specific rollup?



  • 4.  RE: Get-Stat on Powered Off VM

    Posted Apr 29, 2011 06:46 PM

    I set intervalSecs to 1800 and it started reporting data.



  • 5.  RE: Get-Stat on Powered Off VM

    Posted Apr 29, 2011 07:25 PM

    That's another way of selecting Historical Interval 2.

    If you would have put the Start back to more than 1 week, you would also have ended up in HI2.

    See my PowerCLI & vSphere statistics – Part 1 – The basics post for more details.



  • 6.  RE: Get-Stat on Powered Off VM

    Posted Apr 29, 2011 07:36 PM

    That wouldn't have worked for my needs though. Consider that we needs statistics for yesterday, and the VM was powered off this morning. I need data from 12am yesterday to 12am today. The intervalSecs being set to 1800 accomplishes that.