skip to Main Content

Convert thick provisioned disk to thin on VMware ESXi

You want to save disk space and convert thick provisioned disk to thin on VMware ESXi 6.7. It’s good to know that there are three disk types in VMware. Thick provision eager zeroed, thin provision and thick provisioned lazily zeroed, which is the default. You get the task to save disk space on the datastore, and the best advice is to convert thick provisioned to thin on VMware ESXi. What are the options to convert from thick provisioned lazy zeroed disk to thin, and how to do that?

VMware disk types

  • Thick Provision Lazy Zeroed: is a disk that takes all of its space at the time of its creation, but this space may contain some old data on the physical media. This old data is not erased or written over, so it needs to be “zeroed out” before new data can be written to the blocks. This type of disk can be created more quickly, but its performance will be lower for the first writes due to the increased IOPS (input/output operations per second) for new blocks.
  • Thick Provision Eager Zeroed: is a disk that gets all of the required space still at the time of its creation, and the space is wiped clean of any previous data on the physical media. Creating eager zeroed disks takes longer, because zeroes are written to the entire disk, but their performance is faster during the first writes. This sub-type of thick-provisioned virtual disk supports clustering features, such as fault tolerance.
  • Thin Provision: Thin provisioning is another type of storage pre-allocation. A thin-provisioned virtual disk consumes only the space that it needs initially, and grows with time according to demand.

Read more about Thick and Thin Provisioning: What Is the Difference?

How to convert thick provisioning to thin

Convert thick disk provisioning to thin on VMware ESXi with the options:

  1. VMware converter
  2. VMware vCenter (vMotion)
  3. VMware command line (this article)

If you do have vCenter configured, it’s best to move a VM with VMotion and select the virtual disk format Thin Provision in the wizard. You can use VMware converter or command line if you don’t have vCenter, you only have one ESXi host, or don’t want to spend a license to get more features.

Convert thick provisioned to thin with vmkfstools in ESXi Shell (command line)

In this step by step guide, you will learn how to convert a thick provisioned lazy zeroed disk to thin on VMware ESXi 6.7. The steps are the same for other ESXi versions. You will use the vmkfstools command.

The vmkfstools command offers the ability to clone virtual machine content and also convert from one virtual machine disk (.vmdk) format into another.

Read the VMware documentation about cloning and converting virtual machine disks with vmkfstools.

Step 1. Check VMware hard disk type

Log in to VMware ESXi. Click in the left menu on Virtual Machines. In the Virtual Machine list view, right-click on the VM and click Edit Settings.

Good to check is the VM used space. The used space column shows the VM as 60 GB used space.

Convert thick provisioned disk to thin on VMware ESXi edit settings

Expand the Hard disk and check the Type. The hard disk type is thick provisioned, lazily zeroed.

Convert thick provisioned disk to thin on VMware ESXi disk type thick provisioned lazily zeroed

Step 2. Shut down VM

Shut down the VM that you want to convert if you did not do that already.

Virtual machine disk files are locked while in-use by a running virtual machine.

Convert thick provisioned disk to thin on VMware ESXi VM shut down

Step 3. Enable SSH on VMware ESXi host

Enable SSH via the GUI. Expand Host and click on Manage. Click the tab Services and find the service name TSM-SSH. Click on Start.

Convert thick provisioned disk to thin on VMware ESXi 01 start TSM-SSH service

An information banner will show up that the service TSM-SSH successfully started.

Step 4. SSH into the ESXi host

SSH into the host with the application Putty.

Convert thick provisioned disk to thin on VMware ESXi Putty configuration

Log in with the user privileges account.

Step 5. Navigate to the VM folder

Navigate to the VM folder under /vmfs/volumes/ with the command cd vmfs/volumes.

List the name of the VM store with ls -lh

Change to the directory of the datastore. In this example, cd datastore01.

List the VM names in the datastore with ls -lh.

Change to the directory of the VM. In this example, it’s the file server FS01-2016. Run the command cd FS01-2016.

Run the command ls -lh to list the files in the directory.

Step 6. Clone the VMDK to a thin provisioned disk using vmkfstools

Use the command vmkfstools -i FS01-2016.vmdk -d thin FS01-2016-thin.vmdk.

List the files in the directory and verify that two files are created: FS01-2016.thin-flat.vdmk and FS01-2016.thin.vmdk.

Step 7. Rename old flat file

Rename the old file with the command mv FS01-2016-flat.vmdk FS01-2016-flat.vmdk.old.

Step 8. Rename new flat file

Rename the thin flat file with the command mv FS01-2016-thin-flat.vmdk FS01-2016-flat.vmdk.

Step 9. Unregister VM from ESXi

This is necessary for the host to recognize the new disk type. Right-click VM > Unregister.

Convert thick provisioned disk to thin on VMware ESXi unregister VM

Click Yes.

Confirm with Yes to unregister VM

Step 10. Register VM in ESXi

Click on Create / Register VM.

Convert thick provisioned disk to thin on VMware ESXi create/register VM

Select Register an existing virtual machine. Click on Next.

Convert thick provisioned disk to thin on VMware ESXi register an existing virtual machine

Click on Select one or more virtual machines, a datastore, or a directory.

Convert thick provisioned disk to thin on VMware ESXi select VM for registration

Open the VM FS01-2016 and select the FS01-2016.vmx file. Click Select.

Convert thick provisioned disk to thin on VMware ESXi select VMX file

Click on Next.

Select VMs for registration screen

Click Finish.

Ready to complete screen

Step 11. Verify hard disk type conversion

Check the VM hard disk size. In this example, the hard disk changed from 60 GB to 9.56 GB.

Convert thick provisioned disk to thin on VMware ESXi verify VM used space

Right-click on the VM and select Edit Settings.

Convert thick provisioned disk to thin on VMware ESXi VM edit settings

Expand hard disk and check the Type. It shows as Thin provisioned.

Convert thick provisioned disk to thin on VMware ESXi disk type thin provisioned

Step 12. Start the VM

Start the VM and check that everything works as expected.

Step 13. Delete unnecessary VMDK files

Clean up and remove the files. Run the command rm FS01-2016-thin.vmdk && rm FS01-2016-flat.vmdk.old.

Conclusion

In this article, you learned how to convert thick provisioned disk to thin on VMware ESXi. Check the disk type before you start to convert from thick to thin disk in the command line interface. Verify the conversion at the end and start up the system to make sure all is working.

Did you enjoy this article? You may also like Install Kemp virtual load balancer on VMware. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top