A number of customers have raised this question. How do you reclaim disks which were once used by VSAN but you now wish to use these disks for other purposes? Well, first off, if you are using some of the later builds of VSAN and you place the host into maintenance mode and remove the disk group from the host, this will automatically remove the partitions from the disks and you are good to go with reusing these disks for some other purpose. However, if you do something such as reinstall ESXi on the host but do not go through the appropriate VSAN clean up steps first, then there may still be VSAN partition information on the disks. So how do you go about cleaning up these disks?
Well you can begin by trying a partedUtil delete command. But if VSAN is still configured and has claimed those disks, you will get an error similar to the following when you run partedUtil on the disks:
Error: Read-only file system during write on /dev/disks/naa.500xxxxxxxx WriteNewPtable: Unable to commit to device /dev/disks/naa.500xxxxxxxx
At this point, you can try the following steps. The first one is to get this host to leave the VSAN cluster manually. You can do this will the following esxcli command on the ESXi host in question:
esxcli vsan cluster leave
Once the command has returned, you can then begin to unload the VSAN VMkernel modules. There are three in total, vsan, plog and lsomcommon. You would do this as follows:
vmkload_mod -u lsomcommon vmkload_mod -u plog vmkload_mod -u vsan
Next use partedUtil to display the current partitions and delete them from the disk drive:
~ # partedUtil get /dev/disks/naa.500xxxxxx 15566 255 63 250069680 1 2048 6143 0 0 2 6144 250069646 0 0 ~ # partedUtil getptbl /dev/disks/naa.500xxxxxx gpt 15566 255 63 250069680 1 2048 6143 381CFCCC728811E092EE000C2911D0B2 vsan 0 2 6144 250069646 AA31E02A400F11DB9590000C2911D1B8 vmfs 0 ~ # ~ # partedUtil delete /dev/disks/naa.500xxxxxx 1 ~ # partedUtil delete /dev/disks/naa.500xxxxxx 2
There are two partitions, 1 & 2, to delete.
At this point, the disk can now be reused for other purposes such as VMFS or Raw Device Mapping (RDM), or in the case of an SSD, it can now be used for vSphere Flash Read Cache (vFRC).