Listing individual vSAN disk utilization

Unfortunately, many issues with vSAN require the intervention of VMware Support as the available command references are often lacking.

Here is a tidbit to list individual vSAN Disk utilization that I thought might be helpful. BTW. this is in reference to VMware vSAN 6.7 and may or may not work on other versions:


cmmds-tool find -t HOSTNAME -f json | egrep "uuid|hostname" | sed -e 's/\"content\"://g' | awk '{print $2}' | sed -e 's/[\",\},\,]//g' | xargs -n 2 | while read hostuuid hostname; do echo -e "\n\nHost Name: $hostname::: Host UUID: $hostuuid\n Disk Name\t\t| Disk UUID\t\t | Disk Usage | Disk Capacity | Usage Percentage"; cmmds-tool find -f json -t DISK -o $hostuuid | egrep "uuid|content" | sed -e 's/\"content\":|\\"uuid\"://g' | sed -e 's/[\",\},\]//g' | awk '{printf $0}' | sed -e "s/uuid: /\n uuid: /g" | awk '{print $37 " " $2 " " $5 " " $45}' | while read disknaa diskuuid diskcap maxcomp; do if [ $diskcap > 0 ]; then diskcapused=$(cmmds-tool find -f json -t DISK_STATUS -u $diskuuid |grep content |sed -e 's/[\",\},\]//g' | awk '{print $3}'); diskperc=$(echo "$diskcapused $diskcap" | awk '{print $1/$2*100}') ; if [ "$maxcomp" != 0 ];then echo -en " $disknaa\t| $diskuuid\t| $diskcapused\t | $diskcap\t | $diskperc%\n"; fi ; fi ; done ; done

Expected output in this format: Disk Name | Disk UUID | Disk Usage | Disk Capacity | Usage Percentage

naa.5002538c0009db25:2 | 52827b9d-8ca6-9277-821f-ff24edfa8584 | 3317233300275 | 3840745144320 | 86.3695%
naa.5002538c0009b645:2 | 522f8011-6df1-e8a8-decd-02e95b106af9 | 3491720540979 | 3840745144320 | 90.9126%
naa.5002538c0009dd96:2 | 520b3b1b-cb37-37cc-dd85-fabb8de86878 | 3836039344947 | 3840745144320 | 99.8775%

About: John Borhek

John Borhek is the CEO and Lead Solutions Architect at VMsources Group Inc. John has soup-to-nuts experience in Mission Critical Infrastructure, specializing in hyper-convergence and Cloud Computing, engaging with organizations all over the United States and throughout the Americas.


Leave a Reply

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