I’ve been experiencing this scenario quite a bit lately, so I figured I’ll write something about it, also helps me refresh my memory.
Lately I’ve been helping out with a lot of VMware Cloud Foundation Proof of Concepts (VCF POCs)… That’s a mouthful!
Upon inspection of the environment I am supposed to work on, I have found hosts that were once part of a vSAN cluster but were not properly cleaned up prior to ESXi rebuild.
The vSAN clean up process involves the following steps:
- Set host in Maintenance Mode
- Delete Disk Group(s)
- This removes vSAN partitions as well
- Remove host from vSAN cluster
- Clean up network
- Remove from vCenter
As previously mentioned, I usually get called in after the vCenter is gone and hosts have been re-imaged. Now what?!?!
The steps to manually clean the hosts involve the following tasks:
Delete Disk Groups via CLI
Since we do not have access to vCenter in this case, we can delete the Disk Group via CLI using esxcli commands.
You can remove the disks by specifying the ssd cache device to remove that device and all backing capacity devices, or you can do it one device at a time by using the device’s uuid.
To remove the devices one a time you can use vdq -q command to list the devices and then use esxcli vsan storage remove -u <uuid>. I prefer the other method since it is a lot faster…
- List devices by using vdq -i
- Run esxcli vsan storage remove -s <cache device>
- In this case we will run this command for naa.55cd2e404b66fcbb and naa.55cd2e404b4393b9
Now that we have deleted the disk groups, we need to make sure that the host doesn’t think it is still part of a vSAN cluster.
Remove Host from vSAN Cluster via CLI
- Check vSAN cluster membership
- esxcli vsan cluster get
- If it belongs to a cluster, remove it
- esxcli vsan cluster leave
Clean up Network configuration
Since the hosts were re-imaged, this should be all set to default, but in case this was not cleaned up, or was manually re-created, you can clean it up by resetting the configuration.
The following command resets the root, password, overrides all the network configuration changes, and reboots the host. Don’t do this unless you are planning to reset the host to default… You’ve been warned.
At this point, you can use the cleaned host to either join a new vSAN cluster, commission a host in VCF SDDC Manager, or use it as part of the VCF bring up process for the Management Domain.