Skip to content

feat(VMware): Create NetBox cables from ESXi CDP/LLDP neighbors - #535

Open
killaexist wants to merge 1 commit into
bb-Ricardo:mainfrom
killaexist:modify_feat
Open

feat(VMware): Create NetBox cables from ESXi CDP/LLDP neighbors#535
killaexist wants to merge 1 commit into
bb-Ricardo:mainfrom
killaexist:modify_feat

Conversation

@killaexist

@killaexist killaexist commented Aug 22, 2026

Copy link
Copy Markdown

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

Read the docs carefully before running. This tool writes to NetBox.


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:

End Object
A ESXi interface (vmnic…)
B Switch interface (physical port)

Prerequisites (required):

  1. Switches already exist in NetBox (name = CDP/LLDP system name, or the same name without domain).
  2. Physical ports already exist on those switches.
  3. ESXi hosts and vmnic* interfaces exist (normal VMware sync).

No switch or switch port is created by the cable logic—match only.

Flow:

ESXi vmnic → QueryNetworkHint
  CDP:  systemName or devId (Device ID), portId
  LLDP: System Name, Port ID (+ Port Description)
       ↓
Match NetBox device (FQDN ↔ short name)
Match NetBox interface (long ↔ short port names)
       ↓
Create cable if both interface IDs exist

Port name aliases (examples): FastEthernetFa, GigabitEthernetGi, TenGigabitEthernetTe, TwentyFiveGigETwe/TF, XGigabitEthernetXGi.

Cable fields: status connected; type cat5 for FastEthernet/Fa…, else dac-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.

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.
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.

1 participant