Problem:
You have misallocated disk space issues. One VM has too much space and another doesn’t have enough. VMWare allows for you to expand space easily but it doesn’t allow you to shrink it as easily. Meaning, Windows will still report the space that you shrunk as unallocated within Disk Manager.
Solution:
The solution is actually quite elegant. The one caveat to all this is that you have to have enough space on the data store, equal to the size of the intended output. Example, you have a 100GB image and you wish to shrink it to 80GB. You have to have 80+GB of free space on the data store.
- Make sure you’re running VMWare 5 minimum. If you’re running 4 then the idea is the same but the process is different and requires vCenter Server.
- Download and install the VMWare vCenter Converter Standalone on the VM that you wish to resize
- There are 2 ways of doing this, if you shrink the disk size in Windows prior, Converter will recognize the new size and you can accept the defaults, alternatively, follow the directions below.
- Run it
- Click on Convert Machine
- Click Next
- Put in the credentials for your ESXi host and click Next
- Change the Name at the top to make it relevant
- Next
- Select the Datastore that has space for the new image (you can always mount a NAS as iSCSI but that would be a lot slower
- Next
- Under Current Settings, click on edit right beside Data to Copy
- Under Source Volumes, in the destination column, change the size to the new size
- Click Next
- Finish
This will take a while to run. When it’s done, shut down the source VM, boot up the new one and test it accordingly. When ready, delete the old one. I typically wait a week or so.
I found that if you resize the space in Windows first, the whole process is a lot faster.