NSX-T "del nsx" command fails with exception when uninstalling NSX from ESXi Host after abrupt/forceful uninstallation of NSX manager
search cancel

NSX-T "del nsx" command fails with exception when uninstalling NSX from ESXi Host after abrupt/forceful uninstallation of NSX manager

book

Article ID: 411940

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • NSX-T is being uninstalled from Host Transport Node using the command 'del nsx'.
  • Deleting the nsx vibs with command "nsxcli -c del nsx" gives below error:

"%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_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: Mon Nov 07 2022 UTC 07:03:02.307 ERROR: Failed to reset nsxa app of nsx-opsagent. Please check ospagent logs for more details. ESX1.example.com> del nsx"

Environment

VMware NSX

Cause

An ESXi Host cannot have NSX VIBs removed if NSX VTEP vmkernel interfaces are still present or virtual switches contain NSX properties.

Resolution

  1. Check if the vibs are still present on ESXi host: esxcli software vib list | grep nsx
  2. Ensure host is in maintenance mode
  3. Clear properties on all unused logical switches, run the following command on the impacted ESXi host(s):
    /usr/lib64/vmware/nsx-opsagent/bin/nsxcfg-vswitch -s
  4. Remove the IP interfaces related to NSX kernels vmk10 and vmk50: esxcli network ip interface remove -i vmk10 , esxcli network ip interface remove -i vmk50
  5. Forcefully uninstall/delete the nsx vibs: nsxcli -c del nsx
  6. Once the nsx vibs are removed , please go ahead and remove the nsx-dvswitch from GUI.