Why does "eager" vs "lazy" zeroing take much longer when provisioning a VM from a template?

Slightly related to a previous question about thick vs thin provisioning, why does eager zeroing the to-be-cloned VM take longer than lazy zeroing?

For example, in a recent test we ran, an eager-zeroed clone took ~85 minutes to complete, whereas changing to lazy zeroing made it complete in ~50 minutes.

How much overhead is incurred when eager zeroing vs lazy?

When would 'eager' be the right mode to use?


Solution 1:

Eager Zeroing writes 0s to all empty blocks. This slightly increases performance later on when those blocks need to be written to for the first time.

Lazy Zeroing does nothing to the unallocated blocks. If you have an 80GB VMDK and only 10GB worth of data, only 10GB worth of blocks are used and the rest is left as-is until needed. If this example were eager zeroed, at the time of creation all 80GB would be written to, with zeroes filling the remaining 70GB.

If you're using thin provisioning at the storage level, you want to avoid eager zeros, as that will completely defeat the purpose of thin provisioning.

When would 'eager' be the right mode to use?

Eager is the right mode to use when you're not thin provisioning LUNs and you don't mind waiting a bit longer for the VMDK to be created.