Short tip: Reset VSAN cluster

Especially when playing around with multiple vCenter and VSAN versions in a lab, it might be necessary to rebuild a VSAN cluster. In this scenario, it is sometimes also necessary to also reset the SSD and HDD drives used by VSAN. In my lab I'm often resetting the whole VSAN cluster to have a clear starting point - without any VSAN storage upgrades or the like.

For this, shell access to the particular ESXi nodes is activated for a short time. The following commands are executed to list and remove VSAN storage:

1# esxcli vsan storage list
3 Device:
4   Display Name:
5   Is SSD: true
6   VSAN UUID: xxx
9# esxcli vsan storage remove

The partition tables should be empty again:

1# partedUtil get /dev/disks/

Afterwards, the VSAN cluster can be left:

1# esxcli vsan cluster leave

By the way - if you try to remove partitions of a storage device claimed by VSAN, the following error message is shown:

1# partedUtil delete /dev/disks/ 1
2Error: Read-only file system during write on /dev/disks/
3Unable to delete partition 1 from device /dev/disks/