If you are like me then after you installed ESXi you went and created a ton of  virtual hosts, then realized that you were short on disk space.  In doing research on using NFS as a datastore, I read how by default images on NFS were thin provisioned.  In a bit of a jealous moment, I wondered why I didn’t have that option.  I learned that by using the RCLI appliance it is possible to convert.  “Vmkfstools -i” is your friend.  First you must shutdown your VM, in this case called “test-vm”.  Then from the RCLI run the vmkfstools command as follows:



vmkfstools -i /vmfs/volumes/datastore1/test-vm/test-vm.vmdk /vmfs/volumes/datastore1/test-vm/testvm-thin.vmdk -d 'thin' -a lsilogic

The command prompt on the RCLI appliance will not return until the copy/conversion is done, but you can see the progress graphically in the tasks windows on your VI client. Once the copy is done, go into the settings of your VM, delete the hard disk, and add a new hard disk pointing to the “thin” vmdk you created. Boot your vm, if it all works then you can use the datastore browser to delete the thick vmdk and you are done.

  • Share/Bookmark

6 Responses to “How to thin provision an exsiting VMWare disk on ESXi without virtual center”

  1. Jay Rogers says:

    I tried this tip and another from another blog but never see a size difference in the files.

    Starting in the vmfs LUN I want to create the file I have tried:
    vmkfstools -i disk1.vmdk disk1thin -d ‘thin’ -a lsilogic
    and
    vmkfstools -c 10G -d thin disk1.vmdk

    both show the same size:
    [root@esx3srv0101ph hdslun14a]# ls -l
    total 2240
    -rw——- 1 root root 10737418240 Dec 10 13:32 disk1-flat.vmdk
    -rw——- 1 root root 397 Dec 10 14:00 disk1thin
    -rw——- 1 root root 10737418240 Dec 10 13:59 disk1thin-flat
    -rw——- 1 root root 398 Dec 10 13:32 disk1.vmdk

  2. abx21 says:

    Its a sparse file. Kind of like lastlog on a linux system. At least thats what I think.

  3. Derek Bush says:

    To show the difference use ls -s
    The “-s” or “–size” option shows the blocks actually used.

  4. abx21 says:

    Yes, do an ls -lsh, the first column shows the actual size of the file.

  5. aleixsr says:

    Thank you very much, I was crazy with this option until I read it!

  6. [...] de images op thin provisioning. Scheel een pak. http://www.slashzero.com/2008/10/how…irtual-center/ __________________ GlobalServe BVBA – Connecting Your Business And Infrastructure Hosted Exchange [...]

Leave a Reply

(required)

(required)

© 2010 Slashzerø Suffusion WordPress theme by Sayontan Sinha