Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jkullick/5061e6fb1135fe6be63674e0bd87d8ed to your computer and use it in GitHub Desktop.
Save jkullick/5061e6fb1135fe6be63674e0bd87d8ed to your computer and use it in GitHub Desktop.
Convert VMWare ESXi Thick Provisioned Disk to Thin
  1. Power-off VM

  2. Login to ESXi via SSH and convert VMDK to thin provisioned:

vmkfstools -i $THICK_VMDK -d thin $THIN_VMDK
  1. Replace $THICK_VMDK with $THIN_VMDK in the VM settings

  2. Power-on VM

  3. Login to VM to zero disk space:

Linux:

 bash dd if=/dev/zero of=/zero bs=64m rm -f /zero  

Windows:

 1. Download sdelete

 2. Run sdelete -z c:

  1. Power-off VM and login to ESXi via SSH to punchzero the thin disk:

 bash vmkfstools -K $THIN_VMDK  

  1. Power-on VM

  2. Delete $THICK_VMDK from datastore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment