Thanks for your response! Here's what I have tried now but still unsuccessful, Filled the entire disk(a 4GB VMDK) with zeros. From within the guest OS, did "dd if=/dev/zero of=/dev/sdd bs=1048576 ...
See more...
Thanks for your response! Here's what I have tried now but still unsuccessful, Filled the entire disk(a 4GB VMDK) with zeros. From within the guest OS, did "dd if=/dev/zero of=/dev/sdd bs=1048576 count=4096" Shutdown the VM and verified the disk has only zeros. # du -sh ubun-vm1-restore_2-flat.vmdk
4.0G ubun-vm1-restore_2-flat.vmdk
# od -x ubun-vm1-restore_2-flat.vmdk
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
40000000000 Used the shrink API call to reclaim the blocks, ideally when shrink API returns all the blocks should have been reclaimed and usage should be 0. But it still shows 4GB used, # du -sh ubun-vm1-restore_2-flat.vmdk
4.0G ubun-vm1-restore_2-flat.vmdk The API call sequence used, 1. VixDiskLib_ConnectEx()
2. VixDiskLib_Open() with flags 0. Tried using flag VIXDISKLIB_FLAG_OPEN_SINGLE_LINK as well.
3. VixDiskLib_Shrink(vDiskHandle, shrinkProgressFunc, NULL) -> Call returned success
4. VixDiskLib_Close()
5. VixDiskLib_Disconnect() Snippet from vixDiskLib.log, 2022-01-07T07:44:59.714Z| host-5243| I125: Opening file [datastore-2M282402Q0] ubun-vm1-restore/ubun-vm1-restore_2.vmdk (vpxa-nfc://[datastore-2M282402Q0] ubun-vm1-restore/ubun-vm1-restore_2.vmdk@10.1.20.108:902)
2022-01-07T07:44:59.796Z| host-5243| I125: DISKLIB-LINK : Opened 'vpxa-nfc://[datastore-2M282402Q0] ubun-vm1-restore/ubun-vm1-restore_2.vmdk@10.1.20.108:902' (0x8): custom, 8388608 sectors / 4 GB.
2022-01-07T07:44:59.798Z| host-5243| I125: DISKLIB-LIB : Opened "vpxa-nfc://[datastore-2M282402Q0] ubun-vm1-restore/ubun-vm1-restore_2.vmdk@10.1.20.108:902" (flags 0x8, type custom).
2022-01-07T07:44:59.798Z| host-5243| I125: VixDiskLib: VixDiskLib_Shrink: Shrink an existing local disk.
2022-01-07T07:44:59.798Z| host-5243| I125: DISKLIB-LIB : Shrink (Synchronous) chain 7FFFD84C10C8.
2022-01-07T07:44:59.798Z| host-5243| I125: VixDiskLib: VixDiskLib_Close: Close disk. Tried the vmkfstools -K to reclaim the blocks on the same vmdk # du -sh ubun-vm1-restore_2-flat.vmdk
4.0G ubun-vm1-restore_2-flat.vmdk
# vmkfstools -K ubun-vm1-restore_2.vmdk
vmfsDisk: 1, rdmDisk: 0, blockSize: 1048576
Hole Punching: 100% done.
# du -sh ubun-vm1-restore_2-flat.vmdk
0 ubun-vm1-restore_2-flat.vmdk What could possibly be going wrong here that VixDiskLib_Shrink() is unable to reclaim the zeroed blocks which "vmkfstools -K" is able to reclaim?