VMware Cloud Community
someone007
Contributor
Contributor

How can I find entityRefId?

   vhs1 = vcMos['vsan-performance-manager']

   spec = vim.cluster.VsanPerfQuerySpec()

   #spec.entityRefId = "cluster-domclient:68dd9a1a-909f-4df9-b1b5-eab5dc5f0a9c"

   spec.entityRefId = "cluster-domcompmgr:68dd9a1a-909f-4df9-b1b5-eab5dc5f0a9c"


   endTime = datetime.datetime.utcnow()

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

   spec.startTime = startTime

   spec.endTime = endTime

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

how can I find then entityRefId

Reply
0 Kudos
2 Replies
TheBobkin
Champion
Champion

Hello someone007​,

Welcome to Communities.

Looks to be cluster or host that is used as target here:

NAME

TYPEDESCRIPTION



entityRefIdxsd:string

The 'entityRefId' is an entity reference id, which is used to identify the target entity (i.e. clusters, hosts) you want to query. Here an entity reference id consists of an entity type and an UUID of the entity. Its format is <entity-type>:<entity-uuid>. It is possible to pass '*' as the value for entity-uuid in case one wants to query all entities of a certain type. For supported entity types:
See VsanPerfQueryPerf

https://vdc-download.vmware.com/vmwb-repository/dcr-public/b525fb12-61bb-4ede-b9e3-c4a1f8171510/99ba...

The cluster and host you are checking this from UUIDs in question can be retrieved from running:

# esxcli vsan cluster get

or host UUIDs:

# cmmds-tool find -t HOSTNAME

or current host UUID:

# cmmds-tool whoami

Bob

Reply
0 Kudos
someone007
Contributor
Contributor

Can I find it from VM UI?

Reply
0 Kudos