A lab is very dynamic by nature. In stark contrast, data center infrastructure is engineered to be as static as possible once it is configured. So naturally when you have a data center lab you it’s only a matter of time before you come across weird anomalies just from the act of constantly making configuration changes, version updates, bringing systems online, taking systems offline… you get the picture.
I switched NSX network virtualization versions so many times that weird artifacts like N-VDS switches would not go away even when deleted. As I poked around the esxi hosts from a shell I even saw remnants of NSX-V which I deleted years ago! It was time to clear out all of my vSphere hosts of all things NSX.
So my specific situation is that my NSX-T unified manager failed along with many edge nodes. I was not able to uninstall from the NSX-T user interface. Instead I logged into each ESXi host individually and did the following:
Its actually quite easy.
- SSH into your first host.
- Put the host in maintenance mode.
- List all NSX, NSX-T related files with this command.
esxcli software vib list | grep -E 'nsx|vsipfwlib'
- If there are still any VMs attached to any NSX networks, detach them in vcenter.
- Delete all NSX or NSX-T packages and files with this command
nsxcli -c del nsx
- A warning will pop up asking that you check to make sure no NSX networks are still attached to a vm & maintenance mode.
- type yes and hit return.
- after about 30 seconds all NSX networks are gone from the host and if you re-run the command in step 3 nothing will show up.
- ***NOTE you may have to wait another minute for all of the packages to be removed before running the command in step 3 again.
You will have to log into each of your hosts one by one and repeat this process, but it does work cleanly.