Skip to content

fix(VMware): query network hints of all host NICs - #581

Merged
semx merged 2 commits into
bb-Ricardo:developmentfrom
tfoks:fix/vmware-query-network-hint
Oct 8, 2026
Merged

semx merged 2 commits into
bb-Ricardo:developmentfrom
tfoks:fix/vmware-query-network-hint

Conversation

@tfoks

@tfoks tfoks commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

QueryNetworkHint("") raises vim.fault.NotFound on every host, so no CDP/LLDP data is read and sync_host_cables never creates cables. Call it without arguments and log a failing query instead of silently ignoring it.

Tested against vCenter 8.0.3 / NetBox 4.7.2: cables are created and CDP neighbors show up in the pNIC descriptions again.

Fixes #580

🤖 Generated with Claude Code

bb-Ricardo and others added 2 commits October 3, 2026 21:05
QueryNetworkHint() expects an optional list of device names. Passing ""
makes vCenter look up a NIC with an empty name and raise
vim.fault.NotFound, which was silently ignored. As a result no CDP/LLDP
data was ever read: the neighbor info was missing from the pNIC
descriptions and sync_host_cables never created any cables.

Call QueryNetworkHint() without arguments and log a failing query
instead of discarding it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tfoks
tfoks requested review from bb-Ricardo and semx as code owners October 7, 2026 11:23
@bb-Ricardo
bb-Ricardo changed the base branch from main to development October 7, 2026 11:38

@semx semx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, this is right, and it took someone with a real vCenter to see it.

I checked what pyVmomi sends (vcsim -trace): QueryNetworkHint("") goes out as <device></device>, one NIC with an empty name, which vCenter answers with NotFound; QueryNetworkHint() and ([]) send no device element at all. A plain string such as "vmnic0" is serialized as a single element, which is why the per-NIC calls from #535 worked. I brought the "" from #350 back in #565 to save those round trips and only checked it against vcsim, which ignores the argument and returns whatever the capture holds (simulator/host_network_system.go, QueryNetworkHint). That is also why the suite stayed green; a test that answers the call the way vCenter does follows separately.

Two small things, neither blocks: {e} of a pyVmomi fault is a multi-line dump in the log, e.msg is the one-line text. And the branch is off main, so the PR carries the CODEOWNERS commit along; development already has it and the merge is clean, but please branch from development next time, main only receives releases.

@semx
semx merged commit 070f96d into bb-Ricardo:development Oct 8, 2026
3 checks passed
@tfoks
tfoks deleted the fix/vmware-query-network-hint branch October 12, 2026 05:08
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.

VMware: QueryNetworkHint("") raises NotFound, so no CDP/LLDP data is read (sync_host_cables and CDP descriptions do nothing)

3 participants