2 Replies Latest reply on Mar 6, 2020 12:11 AM by KabirAli82

    VSAN cluster performance -vsan sdk

    techlearner123 Lurker

      I am trying to view VSAN cluster performace using below code give in

       

      Online Documentation - vSAN SDKs Programming Guide - VMware {code}

       

      # Get vSAN cluster performance

      def getClusterPerformance(cluster, vsanPerfSystem):

        spec = vim.cluster.VsanPerfQuerySpec()

        spec.entityRefId = "cluster-domclient:5287a00e-e90d-dbdc-1909-bf952fdaad3a"

        endTime = datetime.datetime.utcnow()

        startTime = endTime - datetime.timedelta(hours=1)

        spec.startTime = startTime

        spec.endTime = endTime

        result = vsanPerfSystem.VsanPerfQueryPerf(querySpecs=[spec], cluster=clusterMoID)

        return result

       

      getting exceptions related to clusterMoID .

       

      aceback (most recent call last):

        File "./get_vsan_cluster_performance.py", line 144, in <module>

          main()

        File "./get_vsan_cluster_performance.py", line 141, in main

          getClusterPerformance(cluster, vsanPerfSystem)

        File "./get_vsan_cluster_performance.py", line 75, in getClusterPerformance

          result = vsanPerfSystem.VsanPerfQueryPerf(querySpecs=[spec], cluster=clusterMoID)

      NameError: name 'clusterMoID' is not defined

       

      from where we are getting clusterMoID this data ?