Thinprovisioning will be a new feature of the next release of ESX. However, it is already possible to use thinprovisioning from the service console with the vmkfstools command. Here are some tips (thanks to Richard Garsthagen):
Create a 15GB thinprovisioned disk:
vmkfstools -c 15G -d thin /vmfs/volumes/vmfs_volume/VM_name/thin_disk.vmdk
If you want to convert a thick disk, you can create a copy from it as thin disk. After that, you will need to remove the old disk from the VM and add the new converted copy.
Copy an existing virtual disk to thin provisioned disk:
vmkfstools -i /vmfs/volumes/vmfs_volume/VM_name/large_disk.vmdk -d thin /vmfs/volumes/vmfs_volume/VM_name/new_thin_disk.vmdk
I have tried this with a template-VM, and it works. However, when I take a look at the filesize from the service console I don’t see the actual size of the file:
When I browse the datastore, I can see the real size of the disks:
This 15GB disk is thinprovisioned only 3 GB. When I tried to move the template to another VMFS-volume with only 13GB space left, I got the following error:
Apparently, when you move a VM with a thinprovisioned disk from vCenter server, it converts to a thick-disk. This is because thinprovisioned disks is not integrated with vCenter server yet.
Also, when you deploy from a template with a thinprovisioned disk, the new VM will get a thick-disk.
Be very careful with using thinprovisioned disks. This can cause your VMFS-volume to get out of space, it’s like running a VM with a snapshot on. In the next version of ESX, there will be an alerting mechanism available that will alert the administrator when you run out of diskspace because of growing thinprovisioned disks. I don’t know if the use of thinprovisioned disk in ESX 3.5 is supported or experimental by VMware.
Related articles
Tags: ESX, ESX 4.0, Service console, thinprovisioned disk, thinprovisioning, VMware
8 Responses to “VMware ESX 3.5 and thinprovisioning”
Trackbacks
- Virtually Challenged » Using a thin disk on VMware ESX 3.5
- Virtualization Short Take #24 - blog.scottlowe.org - The weblog of an IT pro specializing in virtualization, storage, and servers
- Thin Provisioning in ESX 3.5 « ben.neise.co.uk



January 14th, 2009 at 11:41 pm
Hi,
Thanks for this great and complete post.You mentioned that Storage VMotion creates thick VM as a result. The same situation happens when cloning the VM or deploying a new VM from template as you said – the thin provisioned source will give you the thick disks, which you may want to manually convert to thin ones, again. Cumbersome, although I like using CLI.
Maybe the new functionality added in VMware vSphere 4 will solve this problem.
Regards,
S.
Reply
April 23rd, 2009 at 5:36 pm
I have also created a small script that will loop through the vmdks and thin them automatically.
cd into the folder that the vmdks resides in. Make sure the VM is powered off. The script will create a temp folder and move the vmdks into this directory. It will then loop through each vmdk and clone them to thin back into the original directory. (Did it this way so you don’t have to modify the vmx)
Start your vm to make sure everything is kosher, then rm –rf /temp
mkdir temp; for f in `ls | egrep ‘*\.vmdk$’` ; do mv $f temp/; done; cd temp; for vmdk in `ls | egrep ‘*\.vmdk$’ | grep -v flat` ; do vmkfstools -i $vmdk ../$vmdk -d thin ; done ;
Reply
Sven Huisman reply on April 29th, 2009 10:11 am:
Great little script, thanks. I won’t use it though, because I use vSphere now
Reply
Walt Kruer reply on May 17th, 2009 6:37 pm:
I am very new to ESX and Vmware. We would like to thin provision all of our VMs so your script will be a great help. I am familiar with batch files but not the linux scripts. What type of file do I need to place the script in and how do I run it?
Reply
Sven Huisman reply on May 28th, 2009 7:11 pm:
My advise would be to don’t use the script. Thin provisioned disks are not supported in 3.5, especially if you are new to ESX.
Use the new vSphere (ESX 4.0) where thin provisioning is supported and integrated in the GUI.
Reply