While querying the performance data for HostSystem using queryPerf method of Performance Manager of vCenter server, I noticed the following behavior, which is not expected.
Configurations:
Library used: vim25(API)
vCenter server version: 6, 6.7
Here are the code snippets and description for the same:
where host_mor stands for the ManagedObjectReference for the HostSystem entity whose performance data is being retrieved. Variable metrics consists counterId of the metric to be retrieved.
Issue ONE:
start_time="2019-06-12T12:56:19.000Z" end_time="2019-06-12T12:59:19.000Z" queryspec = Connection.vim25client.new('PerfQuerySpec', entity=host_mor, metricId=metrics, format=format_type, intervalId=20, startTime=start_time, endTime=end_time) perfdata = Connection.perfManager.queryPerf(queryspec)
Expected behavior:
The vCenter should return the perfdata which will have performance data for the following time range:
First sample: 2019-06-12T12:56:20.000Z
Last sample: 2019-06-12T12:59:00.000Z
While the actual output contains the performance data for the following time range:
First Sample: 2019-06-12T12:56:40Z
Last Sample: 2019-06-12T12:59:20Z
Here, the sample for time 2019-06-12T12:56:20.000Z is missing and sample for time 2019-06-12T12:59:20Z is returned, though it is greater than the end_time.
Issue TWO:
start_time="2019-06-12T10:28:23.862Z" end_time="2019-06-12T10:31:23.862Z" queryspec = Connection.vim25client.new('PerfQuerySpec', entity=host_mor, metricId=metrics, format=format_type, intervalId=20, startTime=start_time, endTime=end_time) perfdata = Connection.perfManager.queryPerf(queryspec)
Expected Behavior:
The vCenter should return the perfdata which will have performance data for the following time range:
First sample: 2019-06-12T10:28:40Z
Last sample: 2019-06-12T10:31:20Z
While the actual output contains the performance data for the following time range:
First sample: 2019-06-12T10:28:20Z
Last Sample: 2019-06-12T10:31:00Z
Here, the sample for time 2019-06-12T10:28:20Z is collected even it is before the specified start_time and the sample for time 2019-06-12T10:31:20Z is missing.
Can someone please look into this and suggest if I am missing anything or it is known behavior.