How to copy a Virtual Machine on VMWare ESXi 4 while maintaining Thin Provisioning

vmware-esxi

We have an ESXi host we use for testing, which results in a ton of VMs being created and copied on a regular basis. We don't have the storage capacity to use thick provisioned VMs on this server, and have been maintaining the copies using VMWare Converter. But using the converter is an incredibly slow operation which copies the entire contents of the VM over the network several times before actually finishing the copy.

Is there a way to simply clone the VM but maintain the thin-provisioning?

Best Answer

I get around this by making copies with the OVFtool from a command line. It isn't perfect, but it does the trick for me (note: ovftool is an app that runs on a linux system somewhere, which then connects to the ESXi host):

#Copy a VM to an OVF (must be turned off, but you can hotclone it to a new VM first if you have vCenter):
ovftool vi://USER:PASSWORD@ESXIHOSTIP/VMNAME TARGETDIR/TARGET.ovf

#Deploy an OVF to an ESX[i] server with thin disks:
ovftool --name="Name of new VM" -dm=thin -ds=TARGET-DATASTORE SOURCEFILE.ovf vi://USER:PASSWORD@ESXIHOSTIP/

You could also try ghettoCloneVM.pl, which is a tool to clone a VM on an ESX or ESXi server without vCenter (but the page says you have to have the "licensed" version of ESXi, not sure if that means the free version won't work). It looks like it has the ability to clone to a thin disk, so it might work for you. I haven't used this tool myself, but it is something to try.