vmroyale, tank you for the reply, but how can we make sure that the "shrink" command is always available in the vmware tools, and the sdelete will actually save space rather than growing the disk?
I have installed ESXi 4 with several guest “Widows Server 2008 32-bit”, “Windows 7 32-bit and 64 bit”, “Windows NT 4.0” and VMWare tools under each guest.
When the guest is installed in the “thick-provisioned” disk, the shrink option is enabled in VMWare Tools, but shrinking does not actually decrease the used space (this is quite expectable for thick disks, but why then the shrink option is enabled?). For thin-provisioned disks, the shrink option is disabled with a message “shrinking is disabled for virtual disks not used in persistent mode and other factors, see documentation for your VMWare product”. However, documentation didn't give an explanation.
Under “Windows NT 4.0” and “Windows 7 64-bit”, shrink was always disable, whether the provisioning was thin or thick.
Since shrink was disabled for thin-provisioned disk under Windows 7 32-bit, I have found an advice to run “sdelete.exe -c” but rather than freeing the space it grew the used space almost to provisioned space.
Does anybody have shrink enabled for thin-provisioned disk, and what guest Windows are you using?
In the meanwhile, I have found only one way to free space on a thin-provisioned disk: use the build-in Windows backup tool to backup the entire system to a network, delete a virtual machne, create a new one and restore the backup, but it is clumsy.