Dongjianhua
Enthusiast
Enthusiast

Questions regarding thin-provision virtual disk sapce reclaim

Hello,

My datastores are almost full, I need to reclaim some disk space from the thin-provision virtual disks, you know when we delete large files inside the virtual machine, the disk space is not free to the datastore. so my questions are:

Q1. For Windows VM, i can use the sdelete tool to zero out the deleted disk space, but for Linux VM is there any tool like this ? Or just use dd ?

Q2. Once i zero the deleted disk space in the VM, is it possible to reclaim the virtual disk's space via storage vmotion ? The KB(https://kb.vmware.com/s/article/2004155) says when using Storage vMotion to move a thin disk between two VMFS volumes with the same block size, null blocks are not reclaimed.  For VMFS-5, the VMFS block size is always 1MB, it seems that use storage vmotion to reclaim space is not possible. Does it mean "vmfstools -K" is the only way ?

Q3. Do i need to stop applications in the VM before running sdelete ? And do i need to shutdown the VM before running "vmfstools -K" ?

Thank you in advance.

0 Kudos
6 Replies
Dongjianhua
Enthusiast
Enthusiast

Hello ?

0 Kudos
SureshKumarMuth
Commander
Commander

Q1. For Windows VM, i can use the sdelete tool to zero out the deleted disk space, but for Linux VM is there any tool like this ? Or just use dd ?

http://virtuallyhyper.com/2012/03/reclaim-space-in-a-vm-on-thin-or-thick-vmdks/

Q2. Once i zero the deleted disk space in the VM, is it possible to reclaim the virtual disk's space via storage vmotion ? The KB(https://kb.vmware.com/s/article/2004155) says when using Storage vMotion to move a thin disk between two VMFS volumes with the same block size, null blocks are not reclaimed.  For VMFS-5, the VMFS block size is always 1MB, it seems that use storage vmotion to reclaim space is not possible. Does it mean "vmfstools -K" is the only way ?

You may use unmap command to reclaim the space

VMware Knowledge Base

Q3. Do i need to stop applications in the VM before running sdelete ? And do i need to shutdown the VM before running "vmfstools -K" ?

Not required, these commands are non disruptive. However, I recommend to do it during non business hours to avoid performance impact on servers as the unmap runs parallely along with normal IO.

Refer the article which I gave in Q2.

Regards, Suresh https://vconnectit.wordpress.com/
0 Kudos
Dongjianhua
Enthusiast
Enthusiast

Sureshkumar,

Thank you for your replay, but i think the unmap command is for reclaiming storage space of thin-provision LUN, not for thin-provision virtual disk(VMDK)...

0 Kudos
SureshKumarMuth
Commander
Commander

Yes, that is for reclaiming the space at storage level.

If you want to reclaim space only the space of virtual disk for free space in DS then you can try P2V if svmotion does not helps.

Regards, Suresh https://vconnectit.wordpress.com/
0 Kudos
Dongjianhua
Enthusiast
Enthusiast

Then how about reclaim space from VMDK ?

0 Kudos
SureshKumarMuth
Commander
Commander

In order to reclaim vmdk space, you have to first use sdelete tool from guest Os then vmkfstools -K (punchzero) , this step  required downtime for your virtual machine,

for more information on steps, please refer the following article

https://kb.vmware.com/s/article/2004155

Regards, Suresh https://vconnectit.wordpress.com/
0 Kudos