Thin Provisioning a ESXi VM
This is from- https://www.reddit.com/r/homelab/comments/78p8lh/how_to_convert_disk_from_thick_to_thin/
How to convert disk from Thick to Thin provisioned in free ESXi
I've had a few VMs which had thick provisioned disks instead of thin, as thick is the default this is quite easy to do.
If you have the paid version of vSphere and two or more hosts managed by vCenter you can simply do a storage vMotion and change the destination disk to thin.
I, like most of the people in this sub, run the free ESXi so this isn't possible. I'll show you how to do it in ESXi via the CLI. I did this on 6.5 but it should work for most versions.
Ensure VM you want to convert is powered down.
Enable SSH via the GUI (Host > Manage > Services > TSM-SSH > Start)
SSH into the host.
Navigate to the VM folder under /vmfs/volumes/ - cd /vmfs/volumes/VM Store/vm01
Clone the vmdk to a thin provisioned disk using vmkfstools - vmkfstools -i vm01.vmdk -d thin thin-vm01.vmdk
Rename old flat file - mv vm01-flat.vmdk vm01-flat.vmdk.old
Rename new flat file - mv thin-vm01-flat.vmdk vm01-flat.vmdk
Unregister VM from ESXi inventory, this is necessary for the host to recognise the new disk type (Right-click VM > Unregister)
Re-register the VM (Create / Register VM > Register an existing virtual machine)
Boot the VM and check all is well.
Delete unnecessary vmdk files - rm thin-vm01.vmdk && rm vm01-flat.vmdk.old
Hope this helps somebody!
______________________________________________
Oh and this too-
Also, if you have used and then deleted contents then you may need to run a tool like sdelete to let VMware know that the blocks can be reclaimed, This reduces space used by my thin disks. Technique is sometimes know as whole punching:
Comments