0 Replies Latest reply on Aug 30, 2018 7:41 AM by nerdstrom

    Performance manager query (QueryPerf) not returning performance counter values

    nerdstrom Lurker

      We have a single vcenter out of a larger set that is not returning any performance counter values for any of its virtual machines.  There are VMs on the vcenter that do have the proper tools installed that should allow us to get this information.  We do not receive any errors when trying to make the query, but nothing is returned - when logging into the vcenter web client, we can see up-to-date performance data for these VMs.

       

      Code Sample:

      def get_test_data():

              global perf_counter_id_to_obj, perf_metrics_id_objects

       

       

              counter_ids = [2, 3, 4, 24, 25, 26, 125, 126, 127, 143, 144, 145]

       

       

              perf_metrics_id_objects = [factory.PerfMetricId(counterId=id,

                                                              instance="*")

                                         for id in counter_ids]

       

       

              start_time = datetime.now() - timedelta(minutes=5)

              end_time = datetime.now()

       

       

              logger.info("Finding vm by uuid")

              vm_found_with_uuid = client.service.FindByUuid(service_content.searchIndex,

                                                             datacenter=None,

                                                             uuid=<uuid>,

                                                             vmSearch=True,

                                                             instanceUuid=True)

              logger.info(f"VM found with uuid: {vm_found_with_uuid}")

       

       

       

       

       

              logger.info(f"Getting query spec for {vm_found_with_uuid}")

              perf_query_list = factory.PerfQuerySpec(maxSample=1,

                                                      entity=vm_found_with_uuid,

                                                      intervalId=300,

                                                      startTime=start_time,

                                                      endTime=end_time,

                                                      format='csv',

                                                      metricId=perf_metrics_id_objects)

              logger.info(f"Query spec for {vm_found_with_uuid}: {perf_query_list}")

       

       

              perf_query_props = client.service.QueryPerf(service_content.perfManager, [perf_query_list])

              logger.info(f"Perf query props (results) are: {perf_query_props}")

      References to "factory" and "client" are how we interact with a SOAP API (given a wsdl file) using the python package `zeep`.

       

      This code returns values in the variable perf_query_props for all of our other vcenters.  We have found that when only passing the "entity" parameter into QueryPerf, we receive daily performance data for each day over the past year (ending two days before the current date).  Furthermore, when we pass "entity" and "intervalId=20", we get up-to-date raw streaming data.  Why can't we get 5 minute intervals?