Thin provisioning an existing VM guest in Esx 4i
Posted on 14 July 2009
Since upgrading to esx 4i I’ve been playing with disk thin-provisioning. I talked a bit about the procedure when I had my mis-adventure with vmware snapshots here . If you want to read more about thin provisioning in vmware click here.
I’ve since converted serveral more vm guests to thin provisioned disks using the command line and vmkfstools.
- Browse the datastores on the host containing the vm to be clone. Verify path to vmdk file (ex. /vmfs/volumes/datastore/Vm-name/Vm-name.vmdk)
- SSH to host (esxi check here for how to enable ssh)
- Use vmkfstools to clone the existing vmdk to new thin-provisioned vmdk. [ # vmkfstools -i /vmfs/volumes/datastore/Vm-name/Vm-name.vmdk /vmfs/volumes/datastore/Vm-name/Vm-name-thin.vmdk -d thin -a lsilogic]
- Once the clone is complete you will see both the original .vmdk file and then newly cloned thin vmdk file. Notice the size difference.
- Modify the .vmx file for the VM guest to point to the newly created VM-name-thin.vmdk for it’s disk.
- Boot the VM and verify everything is working
- Delete old vmdk file (back up first of course ).
Note: If you using snapshot, take a look here for how I cloned and converted a vm that was using snapshots.
Note 2: After the conversion, the vsphere client still showed Thick as the hard drive type, but browsing the data store showed the file had strunk. Right clicking on the thin file allowed an ‘inflate’ which indicates it is thin provisioned. UPDATE: after a shutdown of the guest and reboot or 2 of the host it now shows thin as the disk type.
Other Good information on Thin Provisioning:
Kent’s Blog (however don’t waste your time in Esxi with the vmware tool option for ‘prepare to shrink’ – step 2 in Kent’s. It just took a bunch of time to write large empty files and then after the shrink failed erased them automatically. I guess it’s a good procedure if you want to test your host server drives or something?)
Responses are closed for this post.


