Identify Disk Usage of a Thin Provisioned Virtual Disk

This post demonstrates various ways to identify the disk usage of a thin provisioned virtual disk.

I have a virtual machine with a 10 GB thin provisioned disk. You can verify the disk type from the virtual machine settings page.



Determine disk usage with the vSphere Web Client

You can determine the actual storage usage in the Storage Reports section.
Open Virtual Machine -> Monitor -> Storage Reports and select Virtual Machine Files

Determine disk usage with the vSphere Client

The Storage Browser displays both, the actual size and the provisioned size. The disk has not been touched yet, so the size is displayed with 0 KB.


Determine disk usage with the command line

Open a SSH connection to the ESXi host and navigate to the virtual machine folder. To identify the virtual machines directory I usually use the "esxcli vm process list" command.

The ls -lh command display the configured size, to which the file can grow. The provisioned size is 10 GB.

root@esx3:/vmfs/volumes/ds1/vma $ ls -lh vma_1-flat.vmdk
-rw------- 1 root root 10.0G Nov 7 10:10 vma_1-flat.vmdk

The du -h (Disk Usage) command displays the actual size of the virtual disk. It has grown to 6.2GB.

root@esx3:/vmfs/volumes/ds1/vma $ du -h vma_1-flat.vmdk
6.2G vma_1-flat.vmdk

You can also use the "stat" command to display the number of used blocks and the block size. This file has 12951552 blocks with a blocksize of 512 bytes.

12951552 * 512 bytes = 6,631,194,624 = 6,2 GB

root@esx10:/vmfs/volumes/ds1/vma $ stat -c %b*%B vma_1-flat.vmdk

2 thoughts on “Identify Disk Usage of a Thin Provisioned Virtual Disk”

Leave a Reply to Anonymous Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.