Linux – should I use thick or thin provisioning

centoslinuxthick-provisioningthin-provisioningvmware-esxi

I have a linux vm with 40GB Thick provision Eager Zeroed.
when I login to my ESXI Server I can see that the folder of the VM is about 40GB.
I've created a 10GB file on the linux VM machine. I see that the VM folder on the ESXi grew in 10 GB. I decided to delete the file on the Linux machine and thought the VM folder on the ESXI will shrink as well but it stayed the same as it was after I added the 10GB file.

is it because I'm using Thick provisioning or this is the way VMware VM works?
why didn't the VM folder on the ESXi shrink back to the default size once I deleted the 10GB file?

Thanks!
Dotan.

Best Answer

Thick provision (lazy or eager) never fluctates in size, so I have no idea how you managed to get the folder to grow with a thick disk. You must be running a thin disk.

Storage does not get reclaimed with thick disks - your only option with thick disks is to use a thin-provisioned SAN, and then issue a VAAI UNMAP once you delete files from the datastore. See http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2048466

With thin provisioned disks in vmware you have to do it the following way to reclaim space:

  1. Use a tool on the guest to zero out unused blocks, like sdelete for Windows
  2. Storage migrate the VM to a different datastore as a thin provisioned disk. This will not carry over zero'ed blocks.