Deleting a VSAN diskgroup

After disabling VSAN on a cluster I found that the VSAN diskgroup remained behind. (If it wasnt removed before disabling VSAN.)

In case you did not properly remove a host and still have disks that can not be claimed by vSAN because they still show a state of “In-use for VSAN” you can always remove the disk group manually from the ESXi command line.

But this takes you logging into each node and running esxlcli command to remove the disks.
By running “esxcli vsan storage list” and then once you have identified the SSD thats your cache disk
“esxcli vsan storage remove -s -m noAction” to remove the cache disk, hence killing the diskgroup.

In my environment I only have one vsan disk group, But some quite large clusters. The script could easily be modified to work for multiple vsan Diskgroups.

My prefered method is to use powercli to Perform this action.

  • The script performs a check to make sure vsan isnt enabled. (I don’t want to be removing the Cache disk on a active VSAN)
  • I get a VSAN Storage list. Then remove the cache disk by removing the SSD thats not part of the CapacityTier (But in the VSAN Storage list) so not removing the ESXi install on a SSD for example.