Wiping VSAN data

A few days we decided to rebuild one of our labs. After removing the hosts from the cluster, re-installing a fresh VC and upgrading to the latest ESXi build we found that upon adding the hosts to the new cluster the previous VSAN datastore was present.

VSAN still knew all the data was there and in fact the objects such as the vmdk’s etc still remained. We scratched out head for a second as to what had happened and decided we needed to wipe the VSAN partitions from the disks on those hosts. Thankfully the Ruby vSphere Console has a fantastic and easy way to achieve this.

Firstly you must disable VSAN on the cluster

>vsan.disable_vsan_on_cluster /localhost/EUCVSAN/computers/EUCVSAN
ReconfigureComputeResource EUCVSAN: success
 euc-vsan3.melb.vmware.local: running [                                                                ]
 euc-vsan2.melb.vmware.local: running [                                                                ]
 euc-vsan1.melb.vmware.local: running [                                                                ]

 euc-vsan3.vmware.local: success
 euc-vsan2.vmware.local: success
 euc-vsan1.vmware.local: success

Then we can go about wiping all disks on each host

>vsan.host_wipe_vsan_disks /localhost/EUCVSAN/computers/EUCVSAN/hosts/euc-vsan1..vmware.local/ –force
RemoveDiskMapping euc-vsan1..vmware.local:
 running [=======================================================================================]
 
 RemoveDiskMapping euc-vsan1.melb.vmware.local: success

>vsan.host_wipe_vsan_disks /localhost/EUCVSAN/computers/EUCVSAN/hosts/euc-vsan2.vmware.local/ –force
RemoveDiskMapping euc-vsan2.vmware.local:
 running [=======================================================================================]
 
 RemoveDiskMapping euc-vsan2.vmware.local: success

>vsan.host_wipe_vsan_disks /localhost/EUCVSAN/computers/EUCVSAN/hosts/euc-vsan3.vmware.local/ –force
RemoveDiskMapping euc-vsan3.vmware.local:
 running [=======================================================================================]
 
 RemoveDiskMapping euc-vsan3.vmware.local: success

The next step is to enable VSAN on the cluster again

>vsan.enable_vsan_on_cluster /localhost/EUCVSAN/computers/EUCVSAN/
ReconfigureComputeResource EUCVSAN: success
 euc-vsan3.melb.vmware.local: success
 euc-vsan2.melb.vmware.local: success
 euc-vsan1.melb.vmware.local: success

voila!

Screen Shot 2014-05-30 at 2.18.30 pm