VMware Cloud Community
WSP_Andy
Contributor
Contributor
Jump to solution

How do I create a thin provisioned virtual disk?

Hello all -

I recently upgraded to ESX Infrastructure 3 and I know that it supports thin provisioning for virtual disks and I'm wondering how to do that? I have a number of VMFS volumes out on my SAN and I'd like to create some VMs on one of those that has thin provisioned disks. However, when I go to create a VM, I don't see that option anywhere when I'm attempting to create the disks.

Do I need to do something to the datastores or enable some feature somewhere? My SAN datastore volumes are all VMFS 3 and all of my VirtualCenter software and VM hardware, VM tools, etc., is up to date.

Thoughts?

Reply
0 Kudos
1 Solution

Accepted Solutions
uslacker99
Expert
Expert
Jump to solution

You need to use vmkfstools. The way I do it is just create the VM and go and delete the vmdk files - both, the descriptor and the flat file. Then, just recreate it with:

vmkfstools -c 20g -a lsilogic -d thin filename.vmdk

you can replace the 20g with your desired size, the -a will default to buslogic - if that's okay with you, you can omit it and of course, you give filename, the name that you deleted (not the -flat as the -flat will be automatically created with this command).

View solution in original post

Reply
0 Kudos
6 Replies
uslacker99
Expert
Expert
Jump to solution

You need to use vmkfstools. The way I do it is just create the VM and go and delete the vmdk files - both, the descriptor and the flat file. Then, just recreate it with:

vmkfstools -c 20g -a lsilogic -d thin filename.vmdk

you can replace the 20g with your desired size, the -a will default to buslogic - if that's okay with you, you can omit it and of course, you give filename, the name that you deleted (not the -flat as the -flat will be automatically created with this command).

Reply
0 Kudos
WSP_Andy
Contributor
Contributor
Jump to solution

So there's no way to do this through the latest VI client yet?

Reply
0 Kudos
uslacker99
Expert
Expert
Jump to solution

There should be in 3.5. I'm not sure if it's being backported or not.

WSP_Andy
Contributor
Contributor
Jump to solution

Sure seems like the VI client is trailing ESX's feature set a bit... perhaps it was a tad too soon to get rid of the MUI and all that jazz. <Shrug>

Here's hopin' for 3.5! I'm hoping that someday I almost never have to login to the console.

Thanks for your help!

Reply
0 Kudos
WSP_Andy
Contributor
Contributor
Jump to solution

So here's a quick followup that I should've asked before...

Is there a way to convert an already made "thick" Virtual Disk to a thin provisioned one using the command line tools?

Reply
0 Kudos
uslacker99
Expert
Expert
Jump to solution

yeah. you use the same command.

vmkfstools -i old_file.vmdk newfile.vmdk

Now, you have 2 vmdk's. You'll need to delete the old one and then rename the file with

vmkfstools -E file1.vmdk file2.vmdk

The way to check to see how much the file actually shrank is to use:

du -h