Hi,
I want to shrink a thin provisioned vmdk file, because in the affected virtual machine OS there are many GBs free, but the thin provisioned disk is nearly the same size like a thick provisioned disk.
Regarding the VMware KB2004155, a SVMotion process to another datastore does not shrink the vmdk file.
I have a vSphere 6 environment with VMFS5 datastores only. So (I think) only a block size of 1MB is possible. Maybe this KB article is a little bit confusing.
Maybe somebody has a good ides how I can shrink a thin provisioned disk?
Thanks and Best Regards,
Andre
Due to the unified block size of 1MB, Storage vMotion will not help. However, the KB article you mentioned also contains the steps to reclaim zeroed blocks from the thin provisioned disk using the vmkfstools command line utility.
André
Hi André,
but there is no option to reclaim zeroed blocks from the thin provisioned disk without downtime of the affected VM?
Regards,
Andre
That's unfortunately true. What I could think of - didn't try this myself so far yet - is to Storage vMotion the VM twice (if there's sufficient free space on another datasatore). In the first step select thick provisioned as the target format, and for migrating the VM back to its original datastore, select thin provisioned.
André
Hi André,
this task we have tested already, because my hope also was to shrink the file in that way.
But unfortunately nothiung happened during both SVMotion's...
Regards,
Andre
Please don't mind me asking, but did you select the target virtual disk format in the wizard, and did you zero out unused blocks within the guest OS using e.g. sdelete as mentioned in the KB article?
What I am thinking of is:
André
Hi,
Can you shutdown virtual machine and again svMotion (Thick to Thin) ? You can get back unused space only when the virtual machine is turned off.
Thanks.
First of all the unused blocks should be zeroed out in the guest vm, then run vmkfstool on the vmdk.:
Example:
sdelete c:/
vmkfstool -K yourcdrives.vmdk
As usual, I recommend to test on a dummy vm first, and/or create a backup of your vm.
Related KB: https://kb.vmware.com/s/article/2004155
PS: Just saw this is an old thread, I don't know why was this on the top of my queue