sampling interval of get-stat is changed after the VM is powered off/on

Hello all,


My user is using the below Get-Stat commands on vCenter 5.1 to collect the performance data for the VM ‘VM0000’ daily.

Get-Stat -entity VM0000 -stat cpu.usage.average  -Start <00:00:00 yesterday> -finish<23:59:59 yesterday>

Get-Stat -entity VM0000 -stat mem.usage.average  -Start <00:00:00 yesterday> -finish<23:59:59 yesterday>

Get-Stat -entity VM0000 -stat disk.usage.average -Start<00:00:00 yesterday> -finish <23:59:59 yesterday>


The above commands are executed every day at 0:20 am to collect the data for the previous day.


The sampling interval is 5 minutes until the VM was powered off for about 20 hours for system maintenance.

After the VM was powered on again, the sampling interval was changed from 5 minutes to 30 minutes on the
day the VM was powered on.


However, the next day after the VM was powered on, the sampling interval was back to 5 minutes again.


Any ideas or explanation on this behavior? 


0 Kudos
1 Reply

I suspect it has to with the following:

  • when the VM is not powered on, several counters will not be collected
  • the aggregation of statistical data runs at several times during the day
  • after approx. 1 day, data in Historical Interval 1 will be aggregated to Historical Interval 2
  • the sampling intervals differ, depending on the Historical Interval the data is coming from (HI1 = 300 seconds, HI2 = 1800 seconds,...)
  • when you request metrics through Get-Stat, the cmdlet will look for available data at the time of the Start you specified. Most probably due to the absence of HI1 data at the start of the requested start time, the cmdlet will return the next available data that contains the start time. And that is the HI2 data, with a different sampling interval

See my PowerCLI & vSphere statistics – Part 1 – The basics post, where I (try to)  explain this mechanism as well.

Blog:  Twitter: @LucD22  Co-author PowerCLI Reference