How to Convert the virtual disk provisioning from thick to thin on a standalone ESXi host?
search cancel

How to Convert the virtual disk provisioning from thick to thin on a standalone ESXi host?

book

Article ID: 424743

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps to change the provisioning of a virtual disk from thick to thin on a standalone ESXi host.

Environment

VMware vSphere ESXi 8.x

Resolution

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.

  • Go back to the ESXi Host Client.
  • Right-click the VM and select Edit Settings.
  • Find the Hard Disk, and click the X to remove it. Important: Select "Remove from virtual machine" (do not delete files from the datastore yet).
  • Click Add Hard Disk > Existing Hard Disk.
  • Browse to your VM folder and select the new-thin-disk.vmdk you just created.
  • Save settings and Power on the VM to verify everything works.

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:

  • 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.

  • Log in to the ESXi Host Client.
  • Right-click your VM and select Edit Settings.
  • Click Add hard disk > New standard hard disk.
  • Set the Size to be the same as your current Thick disk.
  • Expand the disk options and set the Type to Thin Provision.
  • Click Save. 

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.

  • Once the data copy is complete, stop any operations using the old disk (or shut down the VM to be safe).
  • Edit Settings of the VM again.
  • Note the SCSI ID of the old Thick disk (e.g., 0:1).
  • Remove the Old Thick Disk (choose "Remove from virtual machine," do NOT "Delete files from datastore" yet).
  • Change the New Thin Disk to the SCSI ID that the old disk used (e.g., change from 0:2 to 0:1). This ensures the OS sees it as the same "slot."

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:

  • Log in to the ESXi Host Client.
  • Go to the Storage tab in the left-hand navigation pane.
  • Select your datastore and click the Datastore Browser.
  • Navigate to the folder of your VM.
  • Locate the old Thick .vmdk file (the one you removed from the VM settings earlier).
  • Right-click the file and select Delete.
    Note: Deleting the .vmdk in the browser will automatically delete the associated -flat.vmdk file, instantly freeing up the physical space on your storage array.