Note – This process is unsupported, and I would only do it in lab…..

These would be the following examples why I would do a quick clean up.

  1. I didn’t want to rebuild the host from scratch in a VCF environment
  2. I have a bad ESXi host configuration
  3. I want to move it into another VCF cluster
  4. I am upgrading the SSD drives

NSX-T

login to the DCUI, Enable ESXi shell and login to the ESXi Shell

type – nsxcli -c del nsx

answer ‘yes’

Check components are gone may take up to 10 minutes to uninstall

esxcli software vib list | grep -E ‘nsx|vsipfwlib’

To remove the software manually if required

esxcli software vib remove -n <vib name>

vSAN Clean-up

ssh to ESXi host

#!/bin/bash

for x in $(vdq –iH| grep “SSD:” | awk ‘{print $NF}’); do esxclivsan storage remove -s $x; done

for x in $(vdq -qH| egrep -o -B2 ‘Eligible’ | grep ‘Name:’ | awk ‘{print $NF}’); do partedUtilmklabel/vmfs/devices/disks/$x gpt; done

Restore ESXi configuration

login to the Direct Console User Interface on the ESXi host > press F2 to access the System Customization > then push enter on reset system configuration

Push F11

push Enter

After the reboot password will be blank, you will need to setup the host configuration again to reuse and re-add to SDDC Manager

By Kader