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.

thin-provisioned-disk

 

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
thin-provisioned-disk-monitor

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.

thin-provisioned-disk-datastore-browser

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
12951552*512

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>