feat(VMware): Create NetBox cables from ESXi CDP/LLDP neighbors - #535
Open
killaexist wants to merge 1 commit into
Open
feat(VMware): Create NetBox cables from ESXi CDP/LLDP neighbors#535killaexist wants to merge 1 commit into
killaexist wants to merge 1 commit into
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.
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.