Every VMDK disk is described by a short text file, the descriptor. It is either a
.vmdk file of its own, next to the extent files that hold the data, or it is
embedded in the first sectors of a sparse
extent. It has three parts: a header, the extent lines, and the disk database. This
page follows the libvmdk project’s description of the format, which builds on VMware’s
Virtual Disk Format technical note.
Syntax
Lines end with a line feed; lines starting # are comments. Keys and
values are written key = value, with strings in double quotes. A
descriptor normally starts with the comment # Disk DescriptorFile.
# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=7d1b4b6c
parentCID=ffffffff
createType="monolithicSparse"
# Extent description
RW 41943040 SPARSE "disk.vmdk"
# The Disk Data Base
#DDB
ddb.adapterType = "lsilogic"
ddb.geometry.cylinders = "2610"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.longContentID = "0fd9dc5bb0e6b7b3e5f81b3a7d1b4b6c"
ddb.uuid = "60 00 c2 9a 4b 1e 5f 7d-87 31 0a 6e 2c 9b 3e 11"
ddb.virtualHWVersion = "21"
Header keys
| Key | Meaning |
|---|---|
version | Descriptor version, 1 to 3. Version 3 adds change tracking (changeTrackPath). |
encoding | Character set of the descriptor: UTF-8 by default. libvmdk lists windows-1252, Shift_JIS, GBK and Big5 (assumed equal to Windows code pages 1252, 932, 936 and 950) and notes that which encodings are supported is unknown. |
CID | Content ID: a random 32-bit number in hex, changed when the disk is first written after being opened. |
parentCID | The parent’s content ID when this disk was made from it; ffffffff means no parent. |
isNativeSnapshot | no in the files seen. |
createType | How the disk is stored: see create types. |
parentFileNameHint | The parent’s descriptor file name, for a child (delta) disk. |
changeTrackPath | In the descriptor’s “Change Tracking File” section, which version 3 introduced. libvmdk’s notes mark the meaning “?” (probably the path of the change-tracking file) and describe the file only as one that “describes changed areas on the virtual disk” (changed block tracking, CBT). The content of that file (usually -ctk.vmdk) is not documented in any source read; its layout is unknown. |
Create types
| Value | Storage |
|---|---|
monolithicSparse | One growing sparse file, with the descriptor embedded. |
monolithicFlat | One fully allocated flat file plus a separate descriptor. |
twoGbMaxExtentSparse (also 2GbMaxExtentSparse) | Sparse extent files of at most 2 GB each (-s001.vmdk, -s002.vmdk…). |
twoGbMaxExtentFlat (also 2GbMaxExtentFlat) | Flat extent files of at most 2 GB each (-f001.vmdk…). |
streamOptimized | One compressed sparse file written in a single pass, for OVF/OVA packages and transfers. |
vmfs | ESX: a flat extent on a VMFS volume (-flat.vmdk). |
vmfsThin | ESX: split into sparse extents of COWD sparse extent data files, like vmfsSparse (libvmdk). Its extents are then VMFSSPARSE lines. |
vmfsPreallocated | ESX: a preallocated extent. |
vmfsEagerZeroedThick | ESX: preallocated and zeroed in advance. |
vmfsSparse | ESX: a sparse (snapshot delta) extent in the COWD format. |
vmfsRaw | ESX: a raw device. |
vmfsRDM (vmfsRawDeviceMap) | ESX: a raw device mapping. |
vmfsRDMP (vmfsPassthroughRawDeviceMap) | ESX: a pass-through raw device mapping. |
fullDevice | A whole physical disk. |
partitionedDevice | Partitions of a physical disk. |
custom | Any other arrangement of extents. |
Extent lines
One line per extent, in disk order:
ACCESS SIZE TYPE "FILENAME" [OFFSET].
| Part | Values |
|---|---|
| Access | RW read and write, RDONLY read only, NOACCESS no access. |
| Size | The extent’s size in 512-byte sectors. |
| Type | FLAT raw data; SPARSE a sparse extent (KDMV); ZERO reads as zeros, no file; VMFS a flat extent on VMFS; VMFSSPARSE a COWD sparse extent; VMFSRDM and VMFSRAW raw device mappings; SESPARSE is an ESXi SEsparse extent (QEMU's reader accepts the line and describes the file). libvmdk marks VMFSRDM and VMFSRAW as TODO (probably physical devices). |
| Further values | libvmdk notes that VMware Player 9 writes two more values after the offset for a physical-device extent on Windows: a partition UUID (6th value) and a device identifier (7th). It gives no format for either. |
| File name | In quotes, relative to the descriptor. Not present for ZERO. |
| Offset | For flat extents only: the sector in the file where this extent’s data starts. |
Disk chains and the content ID
A disk is a chain of links: a base disk and, after each snapshot, a delta link (a redo log) that holds only what the guest
wrote since. Each link has its own descriptor. A link's parentCID is the CID of the link below it;
ffffffff marks a base disk. VMware's note gives the purpose of the content ID: to check that a parent has not
changed since the delta was made (if it has, the delta shall be invalidated), and that the bottom link was not modified between
suspend and resume or between taking a snapshot and reverting to it. parentFileNameHint names the parent link.
Searches for ddb information begin in the descriptor of the bottom link and work up the chain. When a delta link
leaves a grain unallocated (grain table entry 0) the grain is read from the parent; a zeroed-grain entry stays zero. The viewer
applies the parent when it was opened with the child, and flags a parent whose CID is not the child's
parentCID.
Extent files are named relative to the descriptor, and the usual names are -s001.vmdk (sparse slices),
-f001.vmdk (flat slices), -flat.vmdk and -delta.vmdk (ESX).
Disk database
After a #DDB comment, keys starting ddb., all with quoted
values.
| Key | Meaning |
|---|---|
ddb.adapterType | The emulated controller: ide, buslogic, lsilogic or legacyESX. |
ddb.geometry.cylinders, .heads, .sectors | The disk geometry the guest sees. |
ddb.geometry.biosCylinders, .biosHeads, .biosSectors | The BIOS geometry, for physical device disks. |
ddb.virtualHWVersion | The VMware virtual hardware version that made the disk. |
ddb.toolsVersion | The VMware Tools version installed in the guest. |
ddb.uuid | A 128-bit unique identifier, hexadecimal with spaces between the bytes (libvmdk). |
ddb.longContentID | A 128-bit content ID in hex, without spaces. |
ddb.deletable | Seen with the value "true"; libvmdk leaves its meaning as TODO, so it is not documented. |
ddb.thinProvisioned | Seen with the value "1"; libvmdk leaves its meaning as TODO. The name suggests a thin-provisioned disk, but no source says so. |
Programs add other ddb. keys; readers ignore those they do not know.