Shrinking a preallocated VMDK

I'm trying to shrink an 80GB preallocated CentOS VMDK that I've been given from a previous VMware environment, that I've been asked to get running on another host. The billing arrangement for this new running environment allows for the imported dick image to be no more than 50GB in size. Currently, only about 18GB has been used by the guest OS, leaving 62GB of "available disk space" on the VMDK.

Is there a procedure for shrinking a preallocated VMDK? I have of course considered creating a new VM from scratch at the correct size, but there is too much going on on the VM for the option to be feasible.

Any suggestions on shrinking the VMDK or cloning contents from one VMDK to a smaller VMDK would be much appreciated.

Thanks


Have you checked if the disk is sparse or preallocated? If it's sparse, then you can follow the guide in the article already mentioned by John (defrag in Windows and then shrink using VMware Tools). If you succeed you can use for example StarWind V2V converter to basically clone the vmdk to a new ESXi host. You need to connect to the source host, find your vmdk file, connect to a destination host and select the location where to put your vmdk. I used this procedure a couple of times and it worked for a sparse disk.