Sunday, October 26, 2008

ESX 3.5 Thin Provisioned VMDK

I have been working with ESX Server for a long time.  My current server has been upgraded several times and apparently at some point in history, my vmfs was provisioned or converted in "Thick" mode.  This means that all my VMDK's consume all the space they "think" they have.  Anyway I was reading about how you can actually "thin" provision the VM's so you can oversubsribe the data volume.  This is exactly what I want to do.

After some googling around, and at least 3 bad commands, I stumbled across the right command.

vmkfstools - this handly command line tool allows from some really fun stuff on the server.  Turns out is supported exactly what I needed to do.  The command would migrate or copy the current vmdk into a new one that is thin provisioned.  The exact command is as follows:

vmkfstools -i mydiskfile.vmdk -d thin newdiskfile.vmdk

After the disk copy is complete, you can delete the old "fat" or "thick" disk and then use the VMWare console to delete the old disk and re-attach the new "thin" disk.  Was able to free 50% of the space on ESX Server using this method.  It is a little time consuming, but if you are crunched for space, you can't beat it.

Theoretically, there is a way to convert the VMFS volume so that all new disks created are created in "thin" format.  I have been unable to get that working so far.  Additionally, if I had an awesome SAN that sported thin provisioning I wouldn't even have to care about this, but for now, this is about as thin as I can get!

0 comments: