Determining if a VMDK's provisioning type is zeroedthick or eagerzeroedthick
search cancel

Determining if a VMDK's provisioning type is zeroedthick or eagerzeroedthick

book

Article ID: 342229

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article helps you determine if a VMDK's provisioning type is zeroedthick (where blocks are zeroed on first access) or eagerzeroedthick (where all the blocks are zeroed on first created).
 
Note: For functions such as application clustering (including Microsoft Windows Server Failover Cluster; WSFC) and VMware Fault Tolerance, you must ensure that the virtual machine’s disks are eagerzeroedthick format. You can convert a zeroedthick VMDK to eagerzeroedthick using vmkfstools. For more information, see Cloning and converting virtual machine disks with vmkfstools (1028042)

Environment

  • VMware vSphere ESXi 6.0
  • VMware vSphere ESXi 6.5
  • VMware vSphere ESXi 6.7
  • VMware vSphere ESXi 7.0
  • VMware vSphere ESXi 8.0

Resolution

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

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 output. If len (VMDK's file length) = nb (number of allocated blocks) * bs (VMFS's block size) , the VMDK is thick provisioning. Also if tbz is zero (means no block to be zeroed), the VMDK is eagerzeroedthick otherwise it is zeroedthick. In this example, as 12884901888 (len) = 12288 (nb) * 1048576 (bs),the VMDK is thick provisioning and also because tbz = 0, it is eagerzeroedthick .

Lock [type 10c00001 offset 92684288 v 16, hb offset 3342336
gen 63, mode 0, owner 00000000-00000000-0000-000000000000 mtime 2041551
num 0 gblnum 0 gblgen 0 gblbrk 0]
Addr <4, 37, 2>, gen 4, links 1, type reg, flags 0x4, uid 0, gid 0, mode 600
len 12884901888, nb 12288 tbz 0, cow 0, newSinceEpoch 12288, zla 3, bs 1048576
affinityFD <4,34,1>, parentFD <4,34,1>, tbzGranularityShift 20, numLFB 24
lastSFBClusterNum 0, numPreAllocBlocks 0, numPointerBlocks 2

 

(when VMDK is thin provisioning type) .  we can see len (8589934592)  > nb (0) * bs (1048576) 、 the VMDK is thin provisioning (some blocks has not been allocated).  

Lock [type 10c00001 offset 92725248 v 23, hb offset 3342336
gen 63, mode 0, owner 00000000-00000000-0000-000000000000 mtime 2280928
num 0 gblnum 0 gblgen 0 gblbrk 0]
Addr <4, 37, 7>, gen 13, links 1, type reg, flags 0x1, uid 0, gid 0, mode 600
len 8589934592, nb 0 tbz 0, cow 0, newSinceEpoch 0, zla 3, bs 1048576
affinityFD <4,37,7>, parentFD <4,34,1>, tbzGranularityShift 20, numLFB 0
lastSFBClusterNum 0, numPreAllocBlocks 0, numPointerBlocks 0

Notes:

  • 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 -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 (if any 'Z' flagged region), 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 unallocated region it is showed as NOMP  (Unmapped) , so we can identify it is thin disk. 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 (--eagerzero)
 
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 thinProvisioned flag is set, the disk is thin disk otherwise thick disk. Also when the eagerlyScrub flag is set, the disk is eagerzeroedthick .

For example (PowerCLI)

PS> Get-VM VM_NAME | Get-HardDisk | Select Filename,@{N="Thin Provisioned";E={$_.ExtensionData.Backing.thinProvisioned}},@{N="Eager Zeroed";E={$_.ExtensionData.Backing.eagerlyScrub}}

Filename                                   Thin Provisioned Eager Zeroed
--------                                   ---------------- ------------
[DATA_STORE_NAME] VM_FOLDER_NAME/VM_NAME.vmdk              False         True ( EagerZeroed Thick )
[DATA_STORE_NAME] VM_FOLDER_NAME/VM_NAME_1.vmdk             True        False ( Thin Provisioned )
[DATA_STORE_NAME] VM_FOLDER_NAME/VM_NAME_2.vmdk            False        False ( Lazy Zeroed Thick )
 
Note: If the virtual disk is identified as eagerzeroed thick when using the above methods, but not reflected in the edit settings dialog of the vSphere Client, the virtual machine needs to be reloaded in order to reflect the changes. For more information, see Reloading a vmx file without removing the virtual machine from inventory (1026043).