Status Update: ESX Server Sparse Extent

The ESX Server Sparse Extent has the same magic number and very similar header fields, with the existing VMDK3Header. Most code can be reused to add support for this format. Only a few fields are extra to VMDK3Header, they are used to save the extent name/description and detect the unclean shutdown.

The COWDHeader structure is like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
typedef struct {
    uint32_t version;
    uint32_t flags;
    uint32_t disk_sectors;
    uint32_t granularity;
    uint32_t l1dir_offset;
    uint32_t l1dir_size;
    uint32_t free_sectors;
    union {
        struct {
            uint32_t cylinders;
            uint32_t heads;
            uint32_t sectors;
        } root;
        struct {
            char     parentFileName[COWDISK_MAX_PARENT_FILELEN];
            uint32_t parentGeneration;
        } child;
    } u;
    uint32_t       generation;
    char           name[COWDISK_MAX_NAME_LEN];
    char           description[COWDISK_MAX_DESC_LEN];
    uint32_t       savedGeneration;
    char           reserved[8];
    uint32_t       uncleanShutdown;
    char           padding[396];
} __attribute__((packed)) COWDHeader;

So, only tiny changes are needed to handle this header. Now what we need is to collect real world images to test its support.

PS: There’s another important extent type: vmfs. Currently there’s no open specification for it. There’s an open sourcey driver: [http://code.google.com/p/vmfs/][] The driver can do nothing to write to vmfs, because it is implemented by reverse engineering vmfs files. This factor makes adding this format to our driver a hard job.

Comments