Convert a VMDK from Thick to Thin on ESX
This article gives the steps to convert a thick provisioned virtual hard drive VMDK to thin provisioned on ESX 4 or newer versions.
One method you have is an option to Migrate (say vMotion) the VM Guest to another datastore and change the advanced configuration of the hard drive to thin provisioned or If you can't vMotion or migrate the VM to another datastore you can use this vmkfstool command from the VM host to convert it.
Optional steps to check:
- Login to the VM Guest
- Make sure the VMTools are updated
- Run an OS Defrag of the drives
- Use Microsoft SDelete
- http://technet.microsoft.com/en-us/sysinternals/bb897443
- Download and install on the VM Guest OS
- Run sdelete -c
If Powered On VM
- Power Off the VM Guest
- Login to the VM Host that has the VM Guest either by Power CLI or SSH
- You may need to enable SSH and ESX Shell to do this
- Browse to the VM Guest file location
- Example: cd /vmfs/volumes/mydatastore/vmname/
- Clone original disk to a thin copy
- vmkfstools -i SERVERNAME.vmdk -d thin thin-SERVERNAME.vmdk
- Rename the original disk
- vmkfstools -E SERVERNAME.vmdk orig-SERVERNAME.vmdk
- Rename the thin disk to the original disk name
- vmkfstools -E thin-SERVERNAME.vmdk SERVERNAME.vmdk
- Remove VM Guest from VM Host inventory
- Add the VM Guest back to the VM Host inventory
- This so the VM Host registers that it's now a thin provisioned disk/s
- This may not be needed for vSphere 5
- Verify that the VM Guest boots and runs correctly
- Remove original Thick disk/s
- vmkfstools -U orig-SERVERNAME.vmdk
Reference Sources;
http://communities.vmware.com/thread/296983
Note: In Lab Manager 4 undeploy the VM Guest first. The VM Guest does not need to be removed and re-added because undeploying and deploying essentially does that.
No comments:
Post a Comment