Deleting NSX VIBs from an ESXi host using "del nsx" fails with error: Failed to reset nsxa app of nsx-opsagent
search cancel

Deleting NSX VIBs from an ESXi host using "del nsx" fails with error: Failed to reset nsxa app of nsx-opsagent

book

Article ID: 399973

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • ESXi Host has been taken out of the Cluster to un-install NSX and shows as "Not configured" in NSX UI.
  • However, running esxcli software vib list | grep -E 'nsx|vsipfwlib' still shows NSX VIBs are installed on the Host.
  • Attempt to run "del nsx" on the Host results in the following error message:

% Exception when deleting nsx from host: ' error code: 4 stdout: delete_nsx_instance_from_host.sh: INFO: NSX reset script called with argument fabric_node on nsx-esx delete_nsx_instance_from_host.sh: INFO: Run transport_node reset on ESX node % Failed to remove all host switches or logical switches delete_nsx_instance_from_host.sh: ERROR: Failed to reset nsxa app of nsx-opsagent. Please check ospagent logs for more details. , stderr: Tue May 20 2025 UTC 18:56:52.537 ERROR: Failed to reset nsxa app of nsx-opsagent. Please check ospagent logs for more details.'

  • Following error seen in var/run/log/nsx-syslog on the Host:

Er(179) nsx-opsagent[2103086]: NSX 2103086 - [nsx@6876 comp="nsx-esx" subcomp="opsagent" s2comp="nsxa" tid="2103826" level="ERROR" errorCode="MPA42009"] [ApplyDvsList] ApplyDvsList(;reset=False;management;deleteTn=True|50 20 ## ## ## ## ## ##-## ## ## ## ## ## ad 42) failed: dvport <dvport1-UUID> with externalId [externalId1-UUID] is link up; dvport <dvport2-UUID> with externalId [externalId2-UUID] is link up; Failed to hot-swap cvds ['50 20 ## ## ## ## ## ##-## ## ## ## ## ## ad 42']ApplyNsxDvsConfig on (50 20 ## ## ## ## ## ##-## ## ## ## ## ## ad 42) failed: {'fault': 'PlatformConfigFault', 'msg': 'An error occurred during host configuration: .', 'faultMessage': ['Operation failed, diagnostics report: Unable to clear DVS propertycom.vmware.nsx.vdl2.enabled: Status(bad0004)= Busy']}

  • Reviewing VMK interfaces configured on the Host, the VMK interfaces mentioned in the error would still show connected to NSX VLAN based Segments/Logical Switches (esxcfg-vswitch_-l):

     

    DVS Name         Num Ports   Used Ports  Configured Ports  MTU     Uplinks
    ##NSXVDS##        9216        13          512               9000    vmnic5,vmnic6

      DVPort ID                               In Use      Client
      344                                     1           vmnic5
      345                                     1           vmnic6
      vdrPort                                 1           vdr-vdrPort
      spfPort5020############                 0
      dvport3-UUID                            1           vmk10
      dvport4-UUID                            1           vmk11
      dvport5-UUID                            1           vmk50
      349                                     1           vmk0
      350                                     1           vmk3
      dvport1-UUID                            1           vmk1
      dvport2-UUID                            1           vmk2

Environment

VMware NSX

Cause

This is expected behavior where "del nsx" command will fail to remove NSX VIBs if any interfaces are connected to NSX Port Groups.

Resolution

Remove the VMK interfaces identified in the error from the CVDS temporarily to un-install NSX.

Note: This should be done in a maintenance window while the Host is in vSphere Maintenance Mode to avoid any data-path impact.

Additional Information

If after removing the VMK interfaces, NSX VIBs still fail to delete, please refer to the following KBs for further troubleshooting:

Troubleshooting NSX Uninstall Process

NSX VIBs are not removed from an ESXi host