It would be nice to be able to convert a Lazy Zeroed disk to an Eager Zeroed disk after disk creation in VMware - is this possible?
I understand the basic difference between Thick Provision Lazy Zeroed and Thick Provision Eager Zeroed. I usually want to do Lazy Zero so I can create the disk faster. And the eager zeroed performance increase is not large in most circumstances.
However, it would be nice to make the disk Eager Zeroed after disk creation, perhaps as a background task.
Storage vMotion or a powered-off datastore migration will allow you to select a different disk type. Then just migrate the disk back to the original datastore, if desired.
You can use the
vmkfstools
with the -k option. For example:However, you will have to shutdown the VM first and login to the ESXi Shell.
Also, to determine if a disk is zeroedthick or eagerzeroedthick, you can use the same command with the -D parameter as:
Then look for
tbz 0
in the resulting output. If the value is 0 then the disk iseagerzeroedthick
, otherwise it iszeroedthick
.Both commands are described in the follwing VMware KB article:
Determining if a VMDK is zeroedthick or eagerzeroedthick (1011170)
If your VM is running Linux you can use the Zerofree tool to do this. Keep in mind if your running this on the root filesystem you'll first need to mount it as read-only. The Zerofree man page explains how to do this. It's pretty simple.