VMotion to another datastore didn't work:
Just trying to shrink an already thin-provisioned Windows XP VM which is using only 10GB of a 127GB C: drive
I tried to run defrag, sdelete and then shutdown the VM and vmotion to another datastore with a target disk format of thin-provisioned but this failed to reclaim the free space from the VM. By that I mean that the VMDK still used the same diskspace it originally did when it got to the target Datastore.
Instructions from the web
So next step was following instructions from http://www.blackmanticore.com/a30e8ac2ca8f942da4c9b058d92fa089
Problem when trying to run vmkfstools
After running a defrag on c: and sdelete -z c from inside the running VM and shutting it down to complete the vmkfstools -K [disk].vmdk I got
After investigating I found that Backup exec had taken a snapshot of the VM so that it could complete its backup. The fix was to wait till backup exec had completed its backup and removed the snapshot, and therefore the lock it had on the vmdk files. I could then start the vmkfstools -K [disk].vmdk process
How I did the full process:
- Login the VM you want to shrink and defrag the disks
- Install sdelete and run sdelete -z C: (repeat for each drive)
- Shutdown the VM
- Enable SSH on the ESXi host that is hosting the VM and connect via PuTTY
- run vim-cmd vmsvc/getallvms and identify the VM ID and Name
- run vim-cmd vmsvc/get.datastores <ID>
- Using the id get the datastore url
- cd /vmfs/volumes/512d4228-3fbc76e4-93cb-d4ae52ba8566/<NAME>
- Run vmkfstools -K [disk].vmdk to reclaim the zeroed disks blocks.
0 Comments