VM reconfiguration and vmotion fails with error "A general system error occurred: Undeclared fault Cause: An error occurred during host configuration: Failed to attach all ports."
search cancel

VM reconfiguration and vmotion fails with error "A general system error occurred: Undeclared fault Cause: An error occurred during host configuration: Failed to attach all ports."

book

Article ID: 413703

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • When attempting to power on new Virtual Machines (VMs) or relocate existing VMs in a VMware NSX-T environment,  the operation fails.

  • When  vMotion is attempted it fails with error "A general system error occurred: Undeclared fault Cause: An error occurred during host configuration: Failed to attach all ports."

  • When trying to reconfigure a virtual machine it fails with error "An error occurred during host configuration: Failed to attach VIF: bad0006.Failed to attach virtual network interface Unknown to logical switch 5bxxxxxx-9xx1-4xx1-8xxx-6xxxxxxxxxxf, message from NSX: bad0006"
  • When attempting to reconfigure/migrate VMs you may also observe error "Failed to add DVPort in vmkernel: status(bad=006) Limit exceeded while powering on the VM /relocation to this ESXi host after the reconfiguration."

  • Log lines similar to the below are encountered in /var/log/vpxa.log on the affected ESXi host:
2025-09-22T19:34:34.037Z info vpxa[17607500] [Originator@6876 sub=Default opID=432f752f-01-29] [VpxLRO] -- ERROR task-206115 -- vpxa -- vpxapi.VpxaService.registerVm: vim.fault.PlatformConfigFault: --> Result: --> (vim.fault.PlatformConfigFault) { --> faultCause = (vmodl.MethodFault) null, --> faultMessage = (vmodl.LocalizableMessage) [ --> (vmodl.LocalizableMessage) { --> key = "com.vmware.esx.hostctl.default", --> arg = (vmodl.KeyAnyValue) [ --> (vmodl.KeyAnyValue) { --> key = "reason", --> value = "Failed to add DV Port in vmkernel: Status (bad0006)= Limit exceeded" --> } --> ], --> message = "Operation failed, diagnostics report: Failed to add DV Port in vmkernel: Status (bad0006)= Limit exceeded" --> } --> ], --> text = "" --> msg = "An error occurred during host configuration." --> }
  • Log lines in /var/log/nsxaVim.log or nsx-opsagent logs on the ESXi host might indicate errors during the resync.py script execution, such as:
2025-10-06T21:17:49Z In(14) nsxaVim: [44225008]: INFO [resync] resync.py: caught exception: {'fault': 'too many values to unpack (expected 2)'}^@

Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.

Environment

  • VMware NSX

Cause

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

  • This issue is cause by square brackets in the vmx filename (e.g. "example[01]vm.vmx").

Resolution

This is a known issue impacting VMware NSX 4.x.

This issue is resolved in VCF 9.0.2, available at Broadcom downloads.
If you are having difficulty finding and downloading software, please review the Download Broadcom products and software KB.

 

Workaround:

As the issue is caused by presence of square brackets in the VM's vmx filename, to prevent reoccurrence of this issue, you can redeploy the VMs, and use name that doesn't contain square brackets.

If you aren't able to redeploy the VM(s), you can use the workaround below. It is to be introduced on the affected ESXi host(s) to clean up the stale ports. 

Perform these steps on each affected ESXi host:

  1.  Put the ESX host in maintenance mode.
  2. SSH to the ESX and download the modified resync.py script attached to this KB and move to /tmp/ directory on the host.
  3.  Backup existing resync.py.
    cp /usr/lib64/vmware/nsx-opsagent/pyvim/nsxa/resync.py /usr/lib64/vmware/nsx-opsagent/pyvim/nsxa/resync_bk.py
  4.  Disable VisorFSPristineTardisk.
    vsish -e set /config/VisorFS/intOpts/VisorFSPristineTardisk 0
  5. Replace existing resync.py with modified resync.py and change permission.
    cp /tmp/resync.py /usr/lib64/vmware/nsx-opsagent/pyvim/nsxa/resync.py
    
    chmod 444 /usr/lib64/vmware/nsx-opsagent/pyvim/nsxa/resync.py
    
    chown root:root /usr/lib64/vmware/nsx-opsagent/pyvim/nsxa/resync.py
  6.  Execute the resync.py script
    python /usr/lib64/vmware/nsx-opsagent/pyvim/nsxa/resync.py 3600 0 2>&1
  7. The resync logs are present in the /var/log/nsxaVim.log file
  8. verifying that stale ports are cleaned up.
  9.  Enable VisorFSPristineTardisk.
    vsish -e set /config/VisorFS/intOpts/VisorFSPristineTardisk 1
  10.  Exit maintenance mode
    This workaround should be applied to all ESXi hosts in the cluster that are experiencing or are susceptible to this issue.

Attachments

resync.py.txt get_app