In part one of My VSAN journey I outlined the possibility to “clean” your disks if they were previously installed with VSAN or had partitions of different OS on it. You could also see my thought on going cheap on a homelab VSAN nodes with a Haswell low power node. As I was the part of the beta of VSAN and no migration path was proposed, the only way to install VSAN GA product was to wipe the beta. The easy way consisted of just quickly create new VMFS file system on each disk and then delete this partition.
However when completely re-installing my home VSAN installation recently I wasn't able to do that and I had to follow the VMware KB the “hard” way. I say the hard way as you need to remember the CLI commands. That's why this post – to remember and to learn more.
In my case I had a difficulty to create disk group for VSAN where my SSD wasn't showing as available, even though the SSD was there attached and worked well during the VSAN beta.
You'll be using partedUtil command line utility. Quickly typing for help:
partedUtil –help
gives you the the different possibilities.
I had my SSD not showing. So at first I had to check the disk ID with:
esxcli storage core device list
See here:
And then use the partedUtil utility with this command:
partedUtil getptbl “/vmfs/devices/disks/DeviceName”
so in my case:
partedUtil getptbl “/vmfs/devices/disks/DeviceName”
Got me an output like this – a blank disk.
Note: I managed actually to create a datastore via the GUI, but by creating VMFS 3 based datastore when fiddling around with the GUI. That's why through the screenshot you see the disk is blank as I actually managed to delete this VMFS 3 datastore afterwards without problems – via the GUI.
We could stop this excercise here, but for the sake of documentation, I'd like to document the procedure until the end as If I was doing it only through the CLI.
We need to have a partition number in order to be able to delete the partition through the CLI. The command shows that in my case the partition number is 1. I had created a VMFS 3 datastore.
So to delete this partition via partedUtil utility you'll be using this command:
partedUtil delete “/vmfs/devices/disks/DeviceName” PartitionNumber
So in my case:
Remember there is no way to go back and VMware warns you…
Caution: There is no facility to undo a partition table change other than creating a new partition table. Ensure that you have a backup before making any change. Ensure that there is no active I/O to a partition before modifying it.
The command did not returned anything (that's what I like), so it's success…
VMware VSAN and vSphere 5.5 Update 1 were released as GA just few weeks ago. If you have missed this announcement, check out those posts:
- VMware Virtual SAN (VSAN) 1.0 GA – FAQ, Pricing and Design Options
- VMware vSphere 5.5 Update 1 Released
VSAN ready nodes were also recently updated so If you work with a particular vendor, you might want to check out this page where you can see the VSAN Ready Nodes. At the times of writing there were three vendors – Cisco, Dell and Fujitsu. But the list will get longer…
Links and sources:
- VMware KB on this – Using the partedUtil command line utility on ESXi and ESX
- Manually creating a VMFS volume using vmkfstools -C
VSAN in the Homelab – the whole serie:
- My VSAN Journey – Part 1 – The homebrew “node”
- My VSAN journey – Part 2 – How-to delete partitions to prepare disks for VSAN if the disks aren’t clean – (This post)
- Memory Channel per Bank getting non active when using PERC H310 Contoler card – Fixed!
- Infiniband in the homelab – the missing piece for VMware VSAN
- Cisco Topspin 120 – Homelab Infiniband silence
- My VSAN Journey Part 3 – VSAN IO cards – search the VMware HCL
- My VSAN journey – all done!
- How-to Flash Dell Perc H310 with IT Firmware To Change Queue Depth from 25 to 600
Samm says
There is an easy way to clean disks with partitions:
# partedUtil mklabel /dev/disks/ msdos
http://www.vexperienced.co.uk/2012/01/02/error-adding-datastores-to-esxi-resolved-using-partedutil/
Dominik says
Thanks a lot for this blog post. Saved me a lot of time and pain to solve my problem.
OJW says
Once you memorize the path for /vmfs/devices/disks then one easy way to show all of the disk ID’s for removing partitions (using PartedUtil command), you can run command vdq -qH which shows all the disks with their disk ID number, so it is easy to copy paste from that.
Maximize the window so you can see all the vdq -qH output. Copy/paste into you partedUtil delete /vmfs/devices/disks/ command..
Because doing storage core device list is very long and confusing output.
As an alternative, one can use the above command with a filter to clean it up a bunch:
esxcli –formatter=csv –format-param=fields=”Devfs Path” storage core device list
But I find once you memorize the path for the disks, then vdq qH is all you reasonably need