Skip to content

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

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

  1. I use ls -lisah to show file usage:
    1220 67155968 -rw------- 1 root root 100.0G Jan 11 22:28 DFS01_2-flat.vmdk

    This shows my 100GB disk taking up 67,155,968 bytes of disk space (64GB)

Leave a Reply

Your email address will not be published. Required fields are marked *