vmware / vmware/pyvmomi

Host Profile Export BUG

Open
#1,072 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

The export of an host profile via the vSphere web client or via pyVmomi using the ExportProfile method is not deterministic.

Each time ExportProfile() is called the result is different. The same happens via the vCenter GUI.

Reproduction steps
  1. Install pyvmomi via pip3
  2. Use vCenter v8.0.2
  3. Execute the following script:
from pyVim.connect import SmartConnect
from pyVmomi import vim

si = SmartConnect(host='HOSTNAME', user='USERNAME', pwd='PASSWORD', disableSslCertValidation=True)
content = si.RetrieveContent()
pm = content.hostProfileManager
profile = pm.profile[0]
for _ in range(5):
  print(len(profile.ExportProfile()))
  1. The result will be NOT the same, for example this is what happens on my side:
1426335
1426265
1426265
1426265
1426335
  1. Go to the vSphere web client, select an host profile, go to Actions -> Export Host Profile -> Save
  2. Execute the point 5 many times and observe how the XML changes. For example, in my case sometimes there is the following xml tag inside:
    <string xsi:type="xsd:string">VMkernel.Boot.execInstalledOnly</string>
    and sometimes not.
Expected behavior

We expect to have the same output string each time ExportProfile() is called.
We expect to have the same XML vpf file each time we export the profile from the vSphere web client.

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 ExportProfile entry point and reproduce the issue against vCenter 8.0.2 using the SmartConnect script in the report. Compare repeated returned profiles and the vSphere web-client exports; done means repeated exports produce identical output, or the issue is shown to originate in vCenter rather than pyVmomi.

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
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.