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:
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) = the VMDK is thick provisioning and also because tbz = 0, it is eagerzeroedthick .12288 (nb) * 1048576 (bs),
Lock [type 10c00001 offset 92684288 v 16, hb offset 3342336gen 63, mode 0, owner 00000000-00000000-0000-000000000000 mtime 2041551num 0 gblnum 0 gblgen 0 gblbrk 0]Addr <4, 37, 2>, gen 4, links 1, type reg, flags 0x4, uid 0, gid 0, mode 600len 12884901888, nb 12288 tbz 0, cow 0, newSinceEpoch 12288, zla 3, bs 1048576affinityFD <4,34,1>, parentFD <4,34,1>, tbzGranularityShift 20, numLFB 24lastSFBClusterNum 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 3342336gen 63, mode 0, owner 00000000-00000000-0000-000000000000 mtime 2280928num 0 gblnum 0 gblgen 0 gblbrk 0]Addr <4, 37, 7>, gen 13, links 1, type reg, flags 0x1, uid 0, gid 0, mode 600len 8589934592, nb 0 tbz 0, cow 0, newSinceEpoch 0, zla 3, bs 1048576affinityFD <4,37,7>, parentFD <4,34,1>, tbzGranularityShift 20, numLFB 0lastSFBClusterNum 0, numPreAllocBlocks 0, numPointerBlocks 0
Notes:
# vmkfstools -t0 "/vmfs/volumes/my volume/My VM/My VM_1.vmdk"
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.
Note: All blocks have been zeroed and therefore do not contain a 'Z'.
NOMP (Unmapped) , so we can identify it is thin disk. For example: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 )