feat(VMware): Create NetBox cables from ESXi CDP/LLDP neighbors - #535
Merged
semx merged 1 commit intoSep 10, 2026
Merged
Conversation
During host sync, read physical NIC neighbor hints (CDP connectedSwitchPort / LLDP lldpInfo), match switch device and port in NetBox inventory, and create dcim.cable objects (server pNIC ↔ switch port) when both ends resolve.
semx
reviewed
Sep 9, 2026
semx
left a comment
Collaborator
There was a problem hiding this comment.
Verified: merges onto development and the suite stays green. The feature itself looks well put together (own NBCable class, neighbor lookup, port-name expansion). What keeps me from merging it now is that it is unconditional: every deployment whose hosts report CDP/LLDP neighbors would start creating cable objects in NetBox on the next run, and cables are visible, user-managed objects. Please put it behind an option (e.g. sync_host_cables, bool, default False) and document it in settings-example.ini and docs/source_vmware.md. A unit test for _expand_interface_names()/_cable_type_for_port() would be a plus, since the vcsim captures carry no CDP/LLDP data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NetBox-Sync (custom fork)
Fork of bb-Ricardo/netbox-sync with extra automation: NetBox cables from ESXi CDP/LLDP neighbors.
Upstream install, config, sources, and pruning still apply. Details specific to this fork are in the next section.
Sources: VMware vCenter
Fork feature: cables from ESXi CDP/LLDP
During VMware host sync, ESXi physical NICs (
vmnic*) expose CDP/LLDP neighbor data (switch + port). Upstream mainly puts that into the interface description. This fork also creates NetBox cables when both ends already exist:vmnic…)Prerequisites (required):
vmnic*interfaces exist (normal VMware sync).No switch or switch port is created by the cable logic—match only.
Flow:
Port name aliases (examples):
FastEthernet↔Fa,GigabitEthernet↔Gi,TenGigabitEthernet↔Te,TwentyFiveGigE↔Twe/TF,XGigabitEthernet↔XGi.Cable fields: status
connected; typecat5for FastEthernet/Fa…, elsedac-active; description from port description when present; label{server_iface_id}:{switch_iface_id}.Duplicates between the same two interfaces are skipped. New hosts may get cables on the next run once interface IDs exist in NetBox.