vmware / vmware/pyvmomi

pyvmomi 7.0 to call the vCenter 6.7U3,the return value collected from ESXi performance was "-1"

Open
#979 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
2.3k
Forks
763
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Cu use pyvmomi 7.0 to call the vCenter 6.7U3 for ESXi host's performance data.

But sometimes,the return value was "-1". It's not a reasonable value.

--The question were:

1.What's mean with the return value "-1" ?

Was it a special flag ?

2.What's the possible reason for the the return value "-1" ?

--The code as follow:

from pyVim.connect import SmartConnectNoSSL

from pyVmomi import vim

si = SmartConnectNoSSL(host="xxx",user="xxx",pwd="xxx",port=443)

content = si.RetrieveContent()

#list of performance counter we want

perf_list = ["net.usage.average","datastore.read.average"]

#Here to collect performance data

#some code was ignored.At last the value in "perf_list" was put into "spec".

spec = vim.PerformanceManager.QuerySpec(maxSample=1,entity="xxx",metricId="xxxx",intervalId=20)

specs.append(spec)

results = content.perManager.QueryPerf(querySpec=specs)

for entity in results:

print(entity.value) #Sometimes,the output was "-1".

--

Reproduction steps
--The code as follow:

from pyVim.connect import SmartConnectNoSSL

from pyVmomi import vim



si = SmartConnectNoSSL(host="xxx",user="xxx",pwd="xxx",port=443)

content = si.RetrieveContent()



#list of performance counter

perf_list = ["net.usage.average","datastore.read.average"] 

#Here to collect performance data

#some code was ignored.At last the value in "perf_list" was put into "spec".

spec = vim.PerformanceManager.QuerySpec(maxSample=1,entity="xxx",metricId="xxxx",intervalId=20)

specs.append(spec)

results = content.perManager.QueryPerf(querySpec=specs)

for entity in results:

   print(entity.value)
Expected behavior

Cu use pyvmomi 7.0 to call the vCenter 6.7U3 for ESXi host's performance data.

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pyVmomi.vim PerformanceManager.QuerySpec and QueryPerf calls shown in the issue, checking how metricId, entity, and intervalId=20 are populated. Compare the returned value with the VMware vSphere performance API documentation and a minimal reproducible query. Done means identifying whether -1 is a documented sentinel or reporting a confirmed API or binding defect with complete reproduction details.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.