- Zero all unused space inside the VM:
dd if=/dev/zero bs=1048576 of=/zero ; sync ; rm /zero
- Do the same with other mount points, swap partitions, etc.
- Shut down the VM.
- SSH to ESXi, and issue this command:
vmkfstools -K /vmfs/volumes/volumename/vmname/vmname.vmdk
This will take some time… vmkfstools “punches holes” inside your VMDK, e.g. deallocates all blocks that are filled with zeros, effectively shrinking your VMDK.
http://serverfault.com/questions/398162/disk-shrink-does-not-work-on-esxi-guests