1 = Virtual Machine Archive format (VMA) =
3 This format contains a header which includes the VM configuration as
4 binary blobs, and a list of devices (dev_id, name).
6 The actual VM image data is stored inside extents. An extent contains
7 up to 64 clusters, and start with a 512 byte header containing
8 additional information for those clusters.
10 We use a cluster size of 65536, and use 8 bytes for each
11 cluster in the header to store the following information:
13 * 1 byte dev_id (to identity the drive)
14 * 1 byte not used (reserved)
15 * 2 bytes zero indicator (mark zero regions (16x4096))
16 * 4 bytes cluster number
18 We only store non-zero blocks (such block is 4096 bytes).
20 Each archive is marked with a uuid. The archive header and all
21 extent headers includes that uuid and a MD5 checksum (over header
24 All numbers in VMA archive are stored in Big Endian byte order.
29 VMA magic string ("VMA\x00")
32 Version number (valid value is 1)
35 Unique ID, Same uuid is used to mark extents.
38 Backup time stamp (seconds since epoch)
41 Header checksum (from byte 0 to header_size). This field
42 is filled with zero to generate the checksum.
44 48 - 51: blob_buffer_offset
45 Start of blob buffer (multiple of 512)
47 52 - 55: blob_buffer_size
48 Size of blob buffer (multiple of 512)
51 Overall size of this header (multiple of 512)
55 2044 - 3067: uint32_t config_names[256]
56 Offsets into blob_buffer table
58 3068 - 4091: uint32_t config_data[256]
59 Offsets into blob_buffer table
63 4096 - 12287: VmaDeviceInfoHeader dev_info[256]
64 The offset in this table is used as 'dev_id' inside
67 12288 - header_size: Blob buffer
70 === Devive Info Header (VmaDeviceInfoHeader) ===
72 This is use to store details about the contained disk images.
74 Byte 0 - 3: devive name (offsets into blob_buffer table)
78 8 - 15: device size in bytes
82 Note: Devive name 'vmstate' is reserved to store VM RAM state.
86 The blob buffer is used to store both configuration file names and
89 This region contain a list of binary data blobs. Each blob starts with
90 a 2 byte size field, followed by the actual data.
92 == Image Data Streams ==
94 The VMA header is followed by the image data stream. Image data is grouped
95 with extents, which contains up to 59 clusters from different images.
97 === VMA Extent Header ===
100 VMA extent magic string ("VMAE")
105 Overall number of contained 4K block
108 Unique ID, Same uuid as used in the VMA header.
111 Header checksum (from byte 0 to header_size). This field
112 is filled with zero to generate the checksum.
114 40 - 511: blockinfo[59]
117 Each 'blockinfo' (8 bytes) give further details about contained clusters:
120 Bitmap used to indicate non-zero 4K blocks inside the
126 Device ID (offset into dev_info table)
130 The extend header if followed by the actual cluster data, where we only
131 store non-zero 4K blocks.