Error message when attempting to connect VMs to NSX segments.
A general system error occurred: Undeclared fault Cause: An error occurred during host configuration: Failed to attach all ports.An error occured during host configuration: Operation failed, diagnostics report: Failed to add DVPort in vmkernel: status(bad=006)=Limit exceeded
Note: The preceding vCenter excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.
NSX 4.2.2.1
This issue occurs due to an accumulation of stale NSX-backed Distributed Virtual Switch (DVS) ports on ESXi hosts.
When VMs are frequently created and deleted, NSX-T is expected to clear associated logical ports. However, the resync.py script, which is responsible for the periodic cleanup of these stale dvPorts, fails to execute correctly.
The resolution in this environment was to reboot the ESXi hosts.