How to verify the percentage of a Thick Lazy virtual disk file that has been zeroed and how much space remains to be zeroed at a later time.
As discussed in this article there is a potential write performance impact on the first-write to each block in the Lazy Zeroed Thick Disk. If you for some reason would like to know how large part of the Thick Lazy that has been zeroed of a production virtual machine and how much remains to be zeroed later you could use the vmkfstools command from the ESXi command line. This could be done while the VM is running, so no need to power off any machines.
Navigate to the VM folder through the /vmfs/volumes path and then list the file name(s) of the “flat” (data) VMDK, not the small descriptor file. Use for example:
ls -l *flat.vmdk
Above we see a 10 GB flat vmdk file. This is a Lazy Zeroed disk, which has all its space (10 GB = 10737418240) allocated on the data store, however we do not really know what the zeroing status is.
This could be displayed by the command:
vmkfstools -D vm-FLAT.vmdk (Note, must point to the flat file, not descriptor)
From this output some interesting data could be observed.
len = Total size of disk in Bytes.
bs = Block size (would be 1 MB/1048576 Bytes on all new VMFS5 stores).
nb = Total number of blocks of the virtual disk.
This gives that: nb * bs = len
And for the zeroing status: next to nb we find the “tbz” value.
tbz = The number of blocks remaining to be zeroed.
In this example the tbz is 7916 blocks. You could divide this value with nb (total number of blocks) to get the percentage.
Here 7916 blocks out of 10240 remains to be zeroed.
tbz / nb = percent of disk remaining to be zeroed
7916 / 10240 = 0,77 = 77 %
This could be useful to know in a performance troubleshooting situation where being able to verify the exact zeroing status of a Lazy Zeroed disk could give some more piece of information which might or might not be relevant to the situation.