Cloning a VMware ESXi thick disk to a thin disk
Up until now I’ve been building all of my virtual servers with thick provisioned disks. In order to better utilise the available disk, I have decided use thin provisioned disks instead. This is easy enough for new servers but if, like me, you want to convert existing thick provisioned vmdk files to thin provisioned vmdk files just follow the steps below.
1. Launch PuTTY and connect to the ESXi server using SSH
2. Login as the root user
3. Change to the directory that contains the virtual disks for the relevant virtual machine, usually vmfs/volumes/<datastore>/<servername> (where datastore is the name of the data store and servername is the name of the virtual server)
4. Clone the existing thick disk to a thin disk by running the following command:
vmkfstools –i <sourcedisk> -d thin <targetdisk>
(where sourcedisk is the existing thick disk to clone and targetdisk is the new thin disk to create)
5. You can now use the vSphere Client to remove the old thick disk and add the new thin disk by browsing for the new file created in step 4
Update: I have since decided against using thin provisioned disks as one of my SQL server disks grew too big, due to large log files, and filled the datastore. In order to recover from this I had to free up a lot of space by moving VMs to another host.