There are a couple of ways to do this, one is via the vSphere Client GUI and the other is via an SSH connection to the ESXi server. Changing from thick provisioned to thin provisioning is easier in VMware vSphere Client and can be done without an outage.
Changing From Thick To Thin Provisioning Using The GUI (vSphere Client)
To change disks from thick provisioned to thin provisioning, right click the VM in vSphere Client and click Migrate. Select Change datastore and select an alternative datastore with enough free space to move the VM to. From the drop down box (above where you select the datastore to move the VM to), change Thick Provision to Thin Provision and click Next. You may then migrate the VM back to the other datastore if you wish.
If you aren’t able to do this for various reasons, then another way to change the disk from thick to thin provisioning is to backup the disk contents, remove the hard disk from the VM (Edit Settings), create a new thin provisioned disk and restore the data into it. However, this method does require an outage, whilst the datastore migration method can be done while the VM is powered on and in use.
Changing From Thick To Thin Provisioning Using The Command Line (SSH)
There are a number of scenarios in which you would not want to use the vSphere Client to change the provisioning of a disk, such as:
- You do not have a vMotion license and therefore cannot migrate the datastore
- You do not have (or have enough space on) another datastore to migrate the VM to
- You are unable to migrate the VM for some other reasons
In this case you would need to SSH to the ESXi server and run the following command:
vmkfstools –i “NameOfThickdisk.vmdk” -d thin “NewNameOfDisk.vmdk”
You will then have to detach the thick provisioned disk and attach the newly created disk to the VM (Edit Settings -> remove hard disk -> Delete from inventory (you may want to play it safe and delete it from the datastore at the end of the process once you’ve confirmed that everything is working) -> Add new hard disk -> Existing disk). This may be done while the VM is powered on, but it will require an outage while the disks are changed.