vmware / vmware/pyvmomi

Request for Managed Entity Object Sometimes Returns a HostSystem Object

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

Nobody has claimed this yet.

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

Description

Probably between 1/2 to 1/3 of the time when I create a managed entity object I receive a host object. It's frustrating because the issue doesn't present consistently.

content = si.RetrieveContent()

me_obj = get_object(content, [vim.ManagedEntity], host_ip)
In [9]: me_obj
Out[9]: 'vim.HostSystem:host-1826'

host_obj = get_object(content, [vim.HostSystem], host_ip)
In [11]: host_obj
Out[11]: 'vim.HostSystem:host-1826'

I've tried a number of different things including setting the variables to empty before attempts to no avail.

I've been fighting this for a couple of months now but it wasn't mission critical. Now the issue has become much more critical and I still can't figure out what I'm missing. Any help would be greatly appreciated.

verions:
pyvmomi==6.7.0
vCenter 6.7.0 Build 9433931

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 by reproducing the calls shown around get_object(content, [vim.ManagedEntity], host_ip) and get_object(content, [vim.HostSystem], host_ip). Trace how the pyvmomi lookup handles the requested type and returned object, using the reported pyvmomi 6.7.0 and vCenter 6.7.0 versions. Done means the cause of the inconsistent HostSystem result is identified and the requested managed entity type is handled consistently.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.