Symptoms:
Unable to add the disks to vSAN disk group as the disk shows ineligible.
The disk on the vSAN disk management UI page shows a red exclamation mark.
Checking the partition, it shows that there is an existing partition table on the drive:
vSphere vSAN 7.x
vSphere vSAN 8.x
This is expected if there is already a partition table on the drive, we are trying to add to the vSAN disk group.
Behaviour like this is seen when the drive was earlier part of another datastore and is repurposed to be used in vSAN datastore.
We would need to erase the existing partition table on the drive to fix this issue.
Please note: Once we erase the partition table, there is no way to recover data.
That can be done by using the below command:
partedUtil mklabel /vmfs/devices/disks/naa.xxxxxxxxxxxxxx msdos
If in case, the above command reports the following error, we would have to take help from the hardware vendor to erase the existing partition from the drive:
Error: Read-only file system during write on /dev/disks/naa.xxxxxxxxxxxxxWriteNewPtable: Unable to commit to device /vmfs/devices/disks/naa.xxxxxxxxxxxxx
After erasing the partition table, the drive should show eligible, and we should be able to use the drive in vSAN disk group.