Skip to content

govc: Add envbrowser query commands#3985

Open
akutz wants to merge 1 commit intovmware:mainfrom
akutz:feature/govc-env-browser-command
Open

govc: Add envbrowser query commands#3985
akutz wants to merge 1 commit intovmware:mainfrom
akutz:feature/govc-env-browser-command

Conversation

@akutz
Copy link
Copy Markdown
Member

@akutz akutz commented Mar 24, 2026

Description

Add a cli/envbrowser package with three govc commands that wrap the vSphere EnvironmentBrowser managed object API:

  • envbrowser.query-config-option: query VM hardware config options by hardware version and/or guest ID; supports iterating all known hardware versions (VMX-10+)
  • envbrowser.query-config-option-descriptor: list available config option descriptor keys
  • envbrowser.query-config-target: query the config target for a host or cluster

All commands accept -host/-cluster to select the compute object and -copy-to-file to serialize the result as XML.

The directory cli/envbrowser/testdata also includes examples of all of the output from each command when using the -copy-to-file flag.

Closes: NA

How Has This Been Tested?

By running the commands against a real vSphere instance. I will update this PR with tests against vC Sim.

Guidelines

Please read and follow the CONTRIBUTION guidelines of this project.

Copy link
Copy Markdown
Member

@dougm dougm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akutz akutz force-pushed the feature/govc-env-browser-command branch from 847eb0c to 7f9401d Compare March 24, 2026 16:22
@akutz
Copy link
Copy Markdown
Member Author

akutz commented Mar 24, 2026

I haven't looked close yet, sounds similar to these existing commands that use the same Envbrowser methods?

https://github.com/vmware/govmomi/blob/main/govc/USAGE.md#vmoptioninfo https://github.com/vmware/govmomi/blob/main/govc/USAGE.md#vmoptionls https://github.com/vmware/govmomi/blob/main/govc/USAGE.md#vmtargetinfo

Dammit 😁

I looked for an existing command, but missed this somehow. Thanks @dougm . Let me see if I did anything novel, and if I did, if I can fold it into the existing command.

Add a cli/envbrowser package with three govc commands that wrap
the vSphere EnvironmentBrowser managed object API:

- envbrowser.query-config-option: query VM hardware config
  options by hardware version and/or guest ID; supports
  iterating all known hardware versions (VMX-10+)
- envbrowser.query-config-option-descriptor: list available
  config option descriptor keys
- envbrowser.query-config-target: query the config target
  for a host or cluster

All commands accept -host/-cluster to select the compute
object and -copy-to-file to serialize the result as XML.

The directory cli/envbrowser/testdata also includes examples
of all of the output from each command when using the
-copy-to-file flag.

Signed-off-by: akutz <andrew.kutz@broadcom.com>
@akutz akutz force-pushed the feature/govc-env-browser-command branch from 7f9401d to 85acd1a Compare March 24, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants