Attempting to uninstall NSX VIBS from an ESX host while they are still in use causes network connectivity issues
search cancel

Attempting to uninstall NSX VIBS from an ESX host while they are still in use causes network connectivity issues

book

Article ID: 420603

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • You are trying to uninstall NSX VIBs from an ESX host.
  • The host is not in Maintenance Mode.
  • VMs still reside on the host and are using NSX features.
  • The VMs lose network connectivity and are vMotioned/Migrated to other hosts, which restores their network connectivity.
  • Afterwards, attempting to uninstall NSX from the ESX host using nsxcli → del nsx results in the 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 host % 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 opsagent logs for more details. , stderr: <date / time> ERROR: Failed to reset nsxa app of nsx-opsagent. Please check opsagent logs for more details.'

Resolution

Attempting to uninstall NSX VIBS using unsupported procedures can result in unexpected behaviors and outcomes.  To avoid the need to do any of the below, follow the uninstall guide.

Resolution Steps:

  1. Put host into Maintenance Mode
  2. Identify any vmkernel ports that may be using NSX features such as vmk10, vmk11, vmk50, vdrport, spfport etc
    nsxdp-cli vswitch instance list

    From this output you can identify the NSX required vmkernel ports vmk10 and vmk50.  You may also see vmk11 if the host is configured for dual TEPs.
  3. Manually removed all VTEP vmkernel interfaces from the ESX host
    esxcli network ip interface remove --interface-name=vmk10
    esxcli network ip interface remove --interface-name=vmk11
    esxcli network ip interface remove --interface-name=vmk50
  4. Identify the port IDs used by the vdrport and spfport using
    esxcfg-vswitch -l
  5. Followed by the following command modified for the vdrport, spfport, and any other port IDs associated with vmk10 and vmk50
    net-dvs -D -p <vdrportID | spfportID | etc> <dvs name>
  6. Verify there are no VTEP interfaces on the DVS:
    net-dvs -l | grep -i vtep
    NOTE: Only when this returns no results have all the required ports been deleted.
  7. Run the below command to hotswap the CVDS to VDS:
    /usr/lib64/vmware/nsx-opsagent/bin/nsxcfg-vswitch -s

  8. Reboot the host.
  9. When the host is online again, delete any NSX settings from the DVS with the following commands:
    net-dvs -u com.vmware.nsx.kcp.enable -p hostPropList <dvs name>
    net-dvs -u com.vmware.nsx.spf.enabled -p hostPropList <dvs name>
    net-dvs -u com.vmware.nsx.vdl2.enabled -p hostPropList <dvs name>
    net-dvs -u com.vmware.common.nsxUplink -p globalPropList <dvs name>
  10. Enter the NSXCLI
    nsxcli
  11. Use "del nsx" to automatically uninstall all NSX VIBs from the host safely
    del nsx
  12. If it is successful, the command will run for several minutes without feedback, then the nsxcli will exit with the message: Terminated
  13. It may take several minutes to fully uninstall the NSX VIBs.  When complete, the below command will return no results:
    esxcli software vib list | grep -i nsx
  14. Once the VIBs are confirmed removed, NSX has been fully uninstalled from this host.

Additional Information

The error message may lead you to several KBs: