VMware Cloud Community
jicheng_08
Contributor
Contributor

how to get valid blocks in vmdk extent file

In Esxi 6.0, I create a vm in NFS store, every virtual disk of the vm has disk_name.vmdk  and  disk_name-flat.vmdk.

disk_name.vmdk:

# Disk DescriptorFile

version=3

encoding="UTF-8"

CID=164e2cb0

parentCID=ffffffff

isNativeSnapshot="no"

createType="vmfs"

# Extent description

RW 8388608 VMFS "disk_name-flat.vmdk"

# The Disk Data Base

#DDB

ddb.adapterType = "lsilogic"

ddb.deletable = "true"

ddb.geometry.cylinders = "522"

ddb.geometry.heads = "255"

ddb.geometry.sectors = "63"

ddb.longContentID = "2cd42eda8ae3ff5540338b8f164e2cb0"

ddb.thinProvisioned = "1"

ddb.uuid = "d7 07 97 90 a3 6a 48 30-a0 fc d9 55 b9 6d ba 1f"

ddb.virtualHWVersion = "11"

I find https://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf , vmdk file format is discribled.

But I find my disk_name-flat.vmdk is inconsistent with pdf file.

The beginning of the disk_name-flat.vmdk is zero bit.

But in vmdk_50_technote.pdf , the beginning of the file may be ESXi Host Sparse Extent Header, why?

企业微信截图_15707640963718.png

My real purpose is to get valid data on disk by parsing the contents of the vmdk file ,  I hope someone can help me, thanks very much!

4 Replies
continuum
Immortal
Immortal

Flat.vmdks are not virtual disks - they dont use a header like VMFSsparse, Sesparse or Workstation VMDK sparse types.

Treat them like dd images instead.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

jicheng_08
Contributor
Contributor

Thank you very much.

I suppose the flat.vmdk can be prased accord to virtual disk format 5.0 specific, and I can get the valid disk blocks offset (really used by vms), so I can only backup this valid disk blocks. If the flat.vmdk can not be prased . I think I can use vddk 6.7 QueryAllocatedBlocks interface or vsphere api QueryChangedDiskAreas to get disk valid block offset.

Is there any other way to try ?

0 Kudos
continuum
Immortal
Immortal

Forget parsing flat.vmdks.

To develope a backup tool look into ctk.vmdks.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
hwangwenchao
Contributor
Contributor

How did you solve it? At present, I also encountered the same problem. Many data of VMDK in NFS are useless. I am currently parsing the vmdk file, and then filtering out all the invalid data, but it is too slow.
0 Kudos