Print
Hits: 3058

If you use thin VMDK in your lab or dev environments then you probably know that over time these VMs can inflate to very large size.  Say you deployed a windows server and gave the C:\ drive 80GB.  Initially that VM was maybe using ~30GB.  After some time you notice the VM is now 70GB but the OS still claims usage of ~30GB.  This is due to the way data is written and deleted from a disk.  The way to fix is to zero out the whitespace.

  1. Download sdelete from MS.

  2. Run the sdelete.exe utility against the C:\ using the -z parameter.

    sdelete.exe -z C:

  3. Power off VM and ssh to ESXi host.  Find the VMDK and run the following command.

    vmkfstools --punchzero diskname.vmdk

    Check size by typing:

    du -h diskname-flat.vmdk

  4. Finally power on your VM.