This article provides steps to change the provisioning of a virtual disk from thick to thin on a standalone ESXi host.
VMware vSphere ESXi 8.x
To change a VM hard disk from Thick to Thin provisioning on a standalone ESXi host (without vCenter), you must use the command line via SSH. The process involves cloning the disk into a new format. Please ensure you have enough free space on your datastore to hold a second copy of the disk temporarily.
Method 1:
1. Power off the virtual machine. You cannot convert a disk while it is in use.
2. Delete any snapshots. Merging snapshots ensures the base disk is current and prevents errors during the cloning process.
3. Connect to your ESXi host using an SSH client (like PuTTY or Terminal).
4. Navigate to your VM's folder:
cd /vmfs/volumes/DATASTORE_NAME/VM_NAME/
5. Run the vmkfstools command to clone the thick disk into a new thin disk:
# Replace <original-disk.vmdk> with your actual filename
vmkfstools -i <original-disk.vmdk> -d thin <new-thin-disk.vmdk>
6. Swap the Disks in the UI.
7. Once you are sure that the VM is running correctly on the new disk for a few days, you may delete the old thick .vmdk files to reclaim the physical space:
rm <original-disk.vmdk>
rm <original-flat-disk.vmdk>
Method 2:
1. Create a new thin-provisioned hard disk with the same size as the old thick-provisioned one.
2. Format the disk from inside the Guest OS.
3. Copy the data from the old disk to the new disk from inside the Guest OS.
4. Swap the hard disks.
5. Power on and verify.
6. Once you are sure that the VM is running correctly on the new disk for a few days, you may delete the old thick .vmdk files to reclaim the physical space: