VMware ESXi - Converting 'Thick' Provisioned Drives to 'Thin', and 'Thin' to 'Thick'
KB ID 0000579 Dtd 13/03/12
Problem
Thin provisioning of hard drives is pretty cool stuff, full support for thin provisioning was brought in with vSphere version 4. Put simply a thin proviosioned drive is as big as it needs to be, and a thick provisioned drive is set to its maximum size when it's created. The virtual machines that use these hard drives don't know, and assume that their hard drive is a set size (even if it is thin proviosioned).
Thick provisioned drives should be used for machines/applications that will have intensive input/output (RAW mappings are also better for this). But what happens if you want to convert them? From Thin to Thick is very simple (see below), But from Thick to thin is a little more convoluted.
Note: You can change drive provisioning by running the Converter on the virtual machine, and change the disk provisioning as part of the conversion process (click here for details).
Solution
ESXi Converting Thick to Thin Provisioned Drives
1. Here you can see I've got a VM (Server 2008 R2) with a 40GB vmdk file (Hard Drive). You can also see it's in a datastore called 'RAID5'. Before you start make sure the VM using this disk is shut down.
2. Log into your ESX box via SSH, I'm logged in as 'root' if you are not don't forget to 'su'. To find out what the symbolic link is for the RAID5 datastore issue the following comand;
From the output below we can see RAID5 is called "4f214fe5-c5ce77b0-a889-00110a59a5d6".
3. Using the Symlink and the path (from the datastore browser, see step one) you can construct the command, use the following syntax;
If you didn't turn off the machine (I did tell you in step one!) you will see the following;
4. Now we have a "New" thin provisioned drive cloned form the old one, go to the properties of your VM (Edit Settings). And remove the old drive.
5. Then add in your new "Thin" Drive.
6. It should look a little like this.
7. Now power up your VM and, once you are happy, don't forget to DELETE the old thick provisioned drive.
ESXi Converting Thin to Thick Provisioned Drives
1. This is much simpler to do; browse the datastore in question and locate the vmdk file you want to convert. Right click it and select "Inflate".
8. The drive will be converted.
9. You can also see its progress in the VI client's "Recent Taks".