Unable to uninstall NSX on the ESXi host using 'del nsx'
search cancel

Unable to uninstall NSX on the ESXi host using 'del nsx'

book

Article ID: 413573

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

- When you run 'del nsx' on the nsxcli of the ESXi host to uninstall NSX, causing the opsagent to not run and uninstall wont be completed with following error:

33937680 cli.commands.host_shared.register WARNING Error in 'nsx environment delete'. 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: ERROR: Failed to reset nsxa app of nsx-opsagent. Please check ospagent logs for more details.

- This happens when ESXi host is on 7.0.3 but NSX VIBs are installed for 6.7 version

nsx-nestdb 3.1.1.0.0-6.7.17483060 VMware VMwareCertified
nsx-netopa 3.1.1.0.0-6.7.17483060 VMware VMwareCertified
nsx-opsagent 3.1.1.0.0-6.7.17483060 VMware VMwareCertified

Environment

VMware NSX-T Data Center 

VMware vSphere ESXi 7.0.3

Cause

Since there is a mismatch in versions (ESXi version with NSX VIB version), nsxcli (del nsx) will not work in this case

Resolution

Workaround:

1. Delete all VTEPS, vdrPort, spfPort
net-dvs [ -A | -D ] -p port switch_name add/delete a port from a dvswitch

2. Enable ESX MOB

3. Go to https://<esx_ip>/mob/moid=ha-hostdvsmanager&vmodl=1 and use removeDistributedVirtualSwitch to delete the NVDS

4. Manually remove the vibs by:

esxcli software vib remove -n=nsx-adf -n=nsx-context-mux -n=nsx-exporter -n=nsx-host -n=nsx-monitoring -n=nsx-netopa -n=nsx-opsagent -n=nsx-proxy -n=nsx-python-logging -n=nsx-python-utils -n=nsxcli -n=nsx-sfhc -n=nsx-platform-client -n=nsx-cfgagent -n=nsx-mpa -n=nsx-nestdb -n=nsx-python-gevent -n=nsx-python-greenlet -n=nsx-python-protobuf -n=nsx-vdpi -n=nsx-ids; esxcli software vib remove -n=nsx-esx-datapath --no-live-install; esxcli software vib remove -n=vsipfwlib -n=nsx-cpp-libs -n=nsx-proto2-libs -n=nsx-shared-libs

5. If incase any vib is unable to be deleted due to some error, then amend the command and use:

esxcli software vib remove -n vibname --force --no-live-install

6. Perform a reboot after the above steps