vSAN TechTip: Purge vSAN configuration with esxcli
Hi folks! The reuse of ex-vsan hosts could be a painful process if they are simply deleted from vCenter. In fact the correct host decommission from vSAN cluster is realized removing disks from vSAN group in order to be free for another vSAN usage.
It’s known that a simple ESXi host reinstallation doesn’t erase the on-board disk vSAN configuration. For this reason before thrashing disks or doing an endless low-level format, it’s possible force vSAN datastore deletion in every ESXi host using esxcli.
First of all gather disk infos listing all the disks involved in the vSAN cluster.
1 |
esxcli vsan storage list | grep naa |
Now it’s time to remove every single, but it’s necessary ensure that the automatic disk claim is disabled:
1 |
esxcli vsan storage automode set --enabled false |
Then issue the deletion command using -s or -d depending on SSD or Spin Disk:
1 |
esxcli vsan storage remove -s [naa.xxxxxxxxx] |
and finally leave the vSAN cluster
1 |
esxcli vsan cluster leave |
You can check vSAN cluster status simply using the above command with the action get
1 |
esxcli vsan cluster get |
In ESXi UI, no vSAN datastore will be showed and disks are now available for another vSAN usage. That’s all…
Note: this command sequence was tested in my lab after gathering some information from this thread in VMTN.Salva