VMware vSphere

 View Only
  • 1.  Why thin provisioned VM has full size on physical disk?

    Posted Mar 06, 2018 05:18 AM

    Hi,

    I inherited the current VMware environment and notice there is a VM that was thin-provisioned with 100GB and the actual used storage in vCenter shows it's 15GB. However, when I look at the datastore (on NFS sever), the vmdk size is ~100GB. Does this make sense? It seems to beat the purpose of thin provisioning.

    Please let me know if you have any suggestions on how this happens.

    Thank you.



  • 2.  RE: Why thin provisioned VM has full size on physical disk?

    Posted Mar 06, 2018 06:14 AM

    HI vadm168

    What is your NFS server type and Virtual machine guest OS?

    If it is Windows VM - Refer to this KB, VMware Knowledge Base  where it says,

    Note: When using thin provisioned disks with Microsoft operating systems such as Windows 2008 or Windows 7, if you perform a Full Format of the disk, this will inflate the thin provisioned disk to the full size.

    Hope this helps if you are running the same.

    Regards, Raj



  • 3.  RE: Why thin provisioned VM has full size on physical disk?

    Posted Mar 07, 2018 04:14 AM

    Hi Raj,

    You link is very helpful. Let me ask around to see if i can figure out how it was created (e.g. quick format vs. full format).

    Hi Andre,

    I took a look at the NFS datastore itself, ie. the file system on the NetApp and it's not thin.So there should be no 'translation' to inflate the size to thick such as 'provisioned size' column in vsphere client.

    Thanks!



  • 4.  RE: Why thin provisioned VM has full size on physical disk?

    Posted May 19, 2018 12:31 AM

    I did not get a chance to look into this further but I now see another template that behaves like this. Unfortunately I can't confirm whether this disk was formatted via quick or full format..

    Just to add more info on this: the current VM that I see this behavior has the following:

    In VM's settings, the disk says

    Disk file: [ds]lv-win2016test/lv-win2016test_1.vmdk

    'Thin Provision'

    Provisioned Size is 200GB.

    When I SSH to the ESXi,

    /vmfs/volumes/fce81637-c1fff466 # du -sh lv-win2016test

    17.6G   lv-win2016test

    /vmfs/volumes/fce81637-c1fff466 # du -h lv-win2016test/*.vmdk

    16.0K   lv-win2016test/lv-win2016test-flat.vmdk

    4.0K    lv-win2016test/lv-win2016test.vmdk

    17.6G   lv-win2016test/lv-win2016test_1-flat.vmdk

    4.0K    lv-win2016test/lv-win2016test_1.vmdk

    /vmfs/volumes/fce81637-c1fff466/lv-win2016test # ls -lh *vmdk

    -rw-------    1 root     root      200.0G Oct 16  2017 lv-win2016test-flat.vmdk

    -rw-------    1 root     root         504 Oct 16  2017 lv-win2016test.vmdk

    -rw-------    1 root     root      200.0G Oct 17  2017 lv-win2016test_1-flat.vmdk

    -rw-------    1 root     root         533 Oct 16  2017 lv-win2016test_1.vmdk

    If I tar/gz lv-win2016test directory, the size is about 8.8GB. If I scp the .tgz file to another to another ESXi host and untar/unzip it, it takes a long time and shows 200GB for both -flat.vmdk files.

    My questions are:

    1. What's the actual space consumed in the datastore? 200GB? 400GB? or 17.6GB?

    2. I don't understand lv-win2016test_1-flat.vmdk which has "_1" and "-flat", how was it created?

    Thank you.



  • 5.  RE: Why thin provisioned VM has full size on physical disk?

    Posted May 20, 2018 10:45 AM

    /vmfs/volumes/fce81637-c1fff466 # du -h lv-win2016test/*.vmdk

    16.0K   lv-win2016test/lv-win2016test-flat.vmdk

    4.0K    lv-win2016test/lv-win2016test.vmdk

    17.6G   lv-win2016test/lv-win2016test_1-flat.vmdk

    4.0K    lv-win2016test/lv-win2016test_1.vmdk

    That's the space that's consumed on the datastore.

    Thin provisioning on a VMFS datastore is file system feature, i.e. not like sparse files as they are used in e.g. VMware Player, or Workstation. Tool which do not support this feature will "see" a full provisioned file. Any previously unused data block is internally referred to by a NULL pointer, and an application, or tool - which isn't aware of this - reading such a data block will receive zeroes as the response.

    On native Linux file systems the tar command has an option to handle sparse files, but that's unfortunately not available for VMFS file systems (at least I'm not aware of it). In order to transfer virtual disks from one host to another with maintaining thin provisioning you'll need to use tools which support thin provisioning. This can be achieved by e.g. using export/import as OFV, using the ovftool to copy virtual machines directly from one host to another (see e.g. https://www.virtuallyghetto.com/2012/06/how-to-copy-vms-directly-between-esxi.html​), or by using a backup application which supports this

    I don't understand lv-win2016test_1-flat.vmdk which has "_1" and "-flat", how was it created?

    By default, virtual disks are named <vmname>.vmdk for the first one, <vmname>_1.vmdk for the second one, ...

    In this case it looks like someone created a virtual machine, then removed the first virtual disk from the configuration without deleting it from the disk, and then created another virtual disk. I'm pretty sure that lv-win2016test.vmdk isn't used, because its flat.vmdk file still has the initial size of 16kB. To find out about this, check the VM's configuration (.vmx) file, and/or the VM's latest vmware.log file to see whether this file is referenced. Alernatively you may run RVTools (https://www.robware.net/rvtools/) which reports unused files as Zombies in its vHealth tab.

    André



  • 6.  RE: Why thin provisioned VM has full size on physical disk?

    Posted Mar 06, 2018 08:56 AM

    Where exactly do you see the 100GB? Some places show the provisioned size rather than the used disk space.

    André