There are a number of places you can view how your disk space is being used when working with vSphere. The first port of call is the Storage Views pane in the vSphere client, found by selecting either a host or cluster and clicking the Storage Views tab. Here you can view Storage Reports and Storage Maps:
You can customise the Storage Reports screen to show details for virtual machines or for Datastores, LUNs, SCSI paths and others. You can also customise the columns that are on display. Once you have the view set up as required you can right click in any of the white spaces and choose to export the data, with a number of formats to choose from. The following is an example of a datastores report exported as html:
Storage Reports are very useful, but bear in mind that they are updated every 30 mins and are not a realtime view. To get the latest information you can click the ‘Update…’ link.
The Storage Maps pane shows you the relationships between hosts and storage devices. For example:
Another useful screen for viewing space utilisation data in the vSphere client is the Datastore’s Performance tab. First you need to switch to the Datastores inventory view, then select a datastore and click on the performance tab. Here you can view charts on performance and disk space:
There are also a few commands you can run from the CLI to check the disk space on your hosts/datastores. The command ‘df’ will show the used space on your datastores:
~ # df -h Filesystem Size Used Available Use% Mounted on VMFS-5 3.8G 1.4G 2.3G 38% /vmfs/volumes/SAN-VMFS-01 VMFS-5 3.8G 2.6G 1.2G 69% /vmfs/volumes/SAN-VMFS-02 VMFS-5 3.0G 1.4G 1.6G 46% /vmfs/volumes/ESXi1-Local VMFS-3 8.8G 6.9G 1.9G 79% /vmfs/volumes/SAN-VMFS-03 vfat 4.0G 35.2M 4.0G 1% /vmfs/volumes/5220f109-2649adfb-1f45-000c293cc34e vfat 249.7M 146.7M 103.1M 59% /vmfs/volumes/bb6c327c-4406d545-ae70-f4718ed9f900 vfat 249.7M 144.8M 104.9M 58% /vmfs/volumes/782e1c7d-bbfc0ada-7d2f-25f6ac3a110f vfat 285.8M 201.9M 83.9M 71% /vmfs/volumes/5220f0d5-4ad764da-51ee-000c293cc34e
‘vdf’ will show the space on your ESXi hosts volumes:
Ramdisk Size Used Available Use% Mounted on root 32M 560K 31M 1% -- etc 28M 244K 27M 0% -- tmp 192M 8K 191M 0% -- hostdstats 83M 1M 81M 2% --
‘du’ will show you the sizes of files on disk:
/vmfs/volumes/5221687f-72547f8e-a71d-005056af71fa/TestVM03 # du -ha 191.0M ./TestVM03-flat.vmdk 0 ./TestVM03.vmdk 1.0M ./TestVM03.nvram 1.0M ./vmware-2.log 1.0M ./vmware-3.log 1.0M ./vmware-4.log 1.0M ./vmware-1.log 1.0M ./vmware-5.log 8.0K ./TestVM03.vmx 0 ./TestVM03.vmxf 0 ./TestVM03.vmsd 1.0M ./vmware-6.log 1.0M ./vmware-7.log 1.0M ./vmware-8.log 1.0M ./vmware.log 201.0M .
One thing worth noting about ‘du’ is that it reports the true size on disk of thin provisioned virtual disks, whereas other filesystem commands such as ‘ls’ report the allocated size.Keep up to date with new posts on Buildvirtual.net - Follow us on Twitter: Follow @buildvirtual