Skip to content

vmware: sync one interface per FC port when FC-NVMe is enabled - #596

Open
semx wants to merge 1 commit into
developmentfrom
fix/fc-nvme-duplicate-hbas
Open

semx wants to merge 1 commit into
developmentfrom
fix/fc-nvme-duplicate-hbas

Conversation

@semx

@semx semx commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

With FC-NVMe enabled, ESXi lists every Fibre Channel port twice: as a SCSI adapter and as an NVMe adapter (vmhba64 and up) with the same PCI address and port WWN. sync_host_fc_adapters turned both into interfaces, so each port showed up twice in NetBox (reported in #343). Our own vc001 capture has exactly this layout, and the test asserted the duplicates, which I didn't catch in #591.

  • Keep one adapter per port (WWN and PCI address), prefer the SCSI one. An NVMe adapter without a SCSI counterpart is still synced. The skipped twin is logged at DEBUG2.
  • A WWN of 0 now counts as missing. pyVmomi reads an unset WWN as 0, which created an interface with WWN 00:00:00:00:00:00:00:00 instead of skipping the adapter as the option description says.
  • The option description mentions FC-NVMe, settings-example.ini regenerated.

Tested with the vcsim captures and NetBox 4.7.2: a run on development creates 8 FC interfaces on a host with 4 ports, a run with this branch on top keeps vmhba3-6 untouched and tags vmhba64-67 as orphaned, and a second run changes nothing.

With FC-NVMe enabled ESXi lists every Fibre Channel port twice, once as a
SCSI adapter and once as an NVMe adapter (vmhba64 and up) with the same
PCI address and port WWN. Both became interfaces, so each port showed up
twice in NetBox. The vc001 capture has exactly this layout and the test
asserted the duplicates.

Keep one adapter per port (WWN and PCI address) and prefer the SCSI one.
An NVMe adapter without a SCSI counterpart is still synced, and the
skipped twin is logged at DEBUG2.

Also treat a WWN of 0 as missing. pyVmomi reads an unset WWN as 0, which
created an interface with WWN 00:00:00:00:00:00:00:00 instead of skipping
the adapter as the option description says.
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