ESX Server Terminal
VMware ESX hosts have a terminal available for interacting at the console. You may either log into the host remotely via SSH, or by or pressing Alt-F1 while situated directly at the host console or System Management Interface.
Using the VMware ESX terminal, you can determine if a disk is in a zeroedthick or eagerzeroedthick format using:
vmkfstools -D
This is one of two possible vmkfstools commands which provide such disk information. To determine if a VMDK is zeroedthick or eagerzeroedthick, using the -D switch:
# vmkfstools -D "/vmfs/volumes/my volume/ My VM/My VM-flat.vmdk"
Then review the vmkernel, messages, or vmkernel.log system log files. If the output appears similar to the following with tbz at zero, the VMDK is eagerzeroedthick. Otherwise it is zeroedthick:
Lock [type 10c00001 offset 50481152 v 142, hb offset 3518464
gen 987, mode 0, owner 00000000-00000000-0000-000000000000 mtime 102190]
Addr <4, 102, 57>, gen 78, links 1, type reg, flags 0, uid 0, gid 0, mode 600
len 530, nb 1 tbz 0, cow 0, zla 2, bs 65536
Notes:
- Always check the system log files for the output of the vmkfstools as it may contain additional information not displayed to the screen after running the command.
- Always execute vmkfstools -D against the flat file containing the disk data, not the descriptor file when looking for the tbz count.
- TBZ represents the number of blocks in the disk remaining To Be Zeroed.
- vmkfstools -D output in VMware ESX/ESXi 4.1 and later appears in STDOUT. Prior to ESX 4.1, it can be found in /var/log/vmkernel, and in /var/log/messages for ESXi servers.
vmkfstools -t0
This alternative switch for vmkfstools provides a verbose mapping of a stored virtual disk. To determine if a VMDK is zeroedthick or eagerzeroedthick using the -t0 switch, run the command:
# vmkfstools -t0 "/vmfs/volumes/my volume/My VM/My VM_1.vmdk"
If the output appears similar to the following, the VMDK is zeroedthick:
Mapping for file /vmfs/volumes/4a033b51-########-####-##########ad/My VM/My VM_1.vmdk (25769803776 bytes in size):
[ 0: 205520896] --> [VMFS -- LVID:4a033b51-########-####-##########ad/4a033b51-########-####-##########ad/1:( 32108511232 --> 32314032128)]
[ 205520896: 3145728] --> [VMFS -- LVID:4a033b51-########-####-##########ad/4a033b51-########-####-##########ad/1:( 32104316928 --> 32107462656)]
[ 208666624: 3046113280] --> [VMFS -- LVID:4a033b51-########-####-##########ad/4a033b51-########-####-##########ad/1:( 32314032128 --> 35360145408)]
[ 3254779904: 3186622464] --> [VMFS Z- LVID:4a033b51-########-####-##########ad/4a033b51-########-####-##########ad/1:( 35360145408 --> 38546767872)]
[ 6441402368: 46137344] --> [VMFS -- LVID:4a033b51-########-####-##########ad/4a033b51-########-####-##########ad/1:( 38546767872 --> 38592905216)]
[ 6487539712: 2099249152] --> [VMFS Z- LVID:4a033b51-########-####-##########ad/4a033b51-########-####-##########ad/1:( 38592905216 --> 40692154368)]
[ 8586788864: 7997489152] --> [VMFS -- LVID:4a033b51-########-####-##########ad/4a033b51-########-####-##########ad/1:( 40692154368 --> 48689643520)]
[ 16584278016: 9177137152] --> [VMFS Z- LVID:4a033b51-########-####-##########ad/4a033b51-########-####-##########ad/1:( 48689643520 --> 57866780672)]
[ 25761415168: 1048576] --> [VMFS -- LVID:4a033b51-########-####-##########ad/4a033b51-########-####-##########ad/1:( 57866780672 --> 57867829248)]
[ 25762463744: 7340032] --> [VMFS Z- LVID:4a033b51-########-####-##########ad/4a033b51-########-####-##########ad/1:( 57867829248 --> 57875169280)]
Note: The blocks that contain a Z have not yet been written to and are zeroed in the first attempt of the virtual machine to write data on that block.
If the output appears similar to the following, the VMDK is eagerzeroedthick:
Mapping for file My VM_2.vmdk (128849018880 bytes in size):
[ 0: 41252028416] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 255303155712 --> 296555184128)]
[ 41252028416: 1048576] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 296660041728 --> 296661090304)]
[ 41253076992: 59678654464] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 524832276480 --> 584510930944)]
[ 100931731456: 459276288] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 607191040 --> 1066467328)]
[ 101391007744: 614465536] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 584510930944 --> 585125396480)]
[ 102005473280: 1048576000] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 1066467328 --> 2115043328)]
[ 103054049280: 25165824] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 585125396480 --> 585150562304)]
[ 103079215104: 1048576000] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 2115043328 --> 3163619328)]
[ 104127791104: 25165824] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 585150562304 --> 585175728128)]
[ 104152956928: 1048576000] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 3163619328 --> 4212195328)]
[ 105201532928: 25165824] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 585175728128 --> 585200893952)]
[ 105226698752: 1468006400] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 4212195328 --> 5680201728)]
[ 106694705152: 143654912] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 5746262016 --> 5889916928)]
[ 106838360064: 66060288] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 5680201728 --> 5746262016)]
[ 106904420352: 21944598528] --> [VMFS -- LVID:47f4f954-########-####-##########72/47f4f954-########-####-##########72/1:( 5889916928 --> 27834515456)]
Note: All blocks have been zeroed and therefore do not contain a Z.
It is possible that a thin disk is not zeroed out but does not contain a Z . This is because the blocks are not allocated until written. For example:
# vmkfstools -t0 "My VM_3.vmdk"
Mapping for file My VM_3.vmdk (1073741824 bytes in size):
[ 0: 1073741824] --> [NOMP -- :( 0 --> 1073741824)]
vmkfstools -k
This command allows you to convert a preallocated virtual disk to eagerzeroedthick and maintains any existing data:
Note: The virtual machine must be powered off to run this command.
# vmkfstools -k "My VM.vmdk"
VMware APIs and SDKs
If the terminal is not preferred or cannot be accessed, the VMware API can be used as a means of determining a disk's format.
When the eagerlyScrub flag is set, the disk is usable for clustering applications and VMware Fault Tolerance.