vm-disk-chain/v1 environment payload
$id | https://github.com/buildwarden/buildwarden/schemas/v1/environment-vm-disk-chain.json |
| Machine schema | environment-vm-disk-chain/v1.schema.json |
| Applies to | The signed payload of an environment record of type vm-disk-chain/v1 |
| Written by | The qemu, vz, hyperv and firecracker drivers |
Purpose
A virtual machine booted from an ordered chain of disk layers plus per-build
seed files. This schema describes the signed payload bytes, not record
metadata: a reader takes the environment type from the payload's type
member (see Environment types).
The relay signs this descriptor as the orchestrator asserts it; the build
guest never writes it.
Payload
{
"type": "vm-disk-chain/v1",
"driver": "hyperv",
"guest_os": "windows",
"arch": "amd64",
"generation": 1,
"layers": [
{"role": "disk", "name": "windows-server-2025.vhd", "format": "vhd",
"path": "C:\\Users\\me\\AppData\\Local\\warden\\hyperv\\images\\windows-server-2025.vhd",
"sha256": "<64 hex>", "size": 10737418240,
"source": {"kind": "url", "url": "https://...", "pinned": true}}
],
"seed": [
{"name": "build-script", "sha256": "<64 hex>", "size": 120},
{"name": "warden-io.exe", "sha256": "<64 hex>", "size": 9123456}
]
}
No member outside those listed below is allowed, at any level.
| Field | Required | Description |
|---|---|---|
type | yes | "vm-disk-chain/v1". |
driver | yes | The driver that booted the VM (qemu, vz, hyperv, firecracker). |
guest_os, arch | yes | Guest OS (linux, windows, macos) and Go architecture name (amd64, arm64, ...). |
generation | no | Hyper-V VM generation, an integer of at least 1; omitted elsewhere. |
layers | yes | Ordered files the VM boots from, at least one. Entries with role: disk form the disk chain base-first: each later disk is a child (differencing / backing-file overlay) of the one before. The per-build writable disk is not a layer: an empty child of the last disk, or for firecracker, which boots a raw image with no overlay, a copy of it. |
layers[].role | yes | disk, or one of kernel, initrd (direct boot), nvram (UEFI variables, VZ auxiliary storage), platform (VZ hardware model, machine identifier). |
layers[].name | yes | Non-empty file name. |
layers[].format | no | Disk format (vhd, vhdx, qcow2, raw, ...). |
layers[].sha256, size | yes | SHA-256 (64 lowercase hex) and size in bytes of the file as booted. |
layers[].path | no | Host path at build time, where a verifier finds the file. Host-local; it may reveal the host's directory layout. |
layers[].source | yes | Provenance. kind: url — downloaded from url (required); pinned when it verified against an expected hash supplied independently of the download. kind: local — supplied by the user, or changed since warden recorded it. kind: prepared — produced by warden: prepared_by (required) is "warden <version>" and inputs lists the hashed inputs ({name, sha256?, size?, url?}, name required) it was produced from, e.g. the install ISO or IPSW, or for a prepared differencing layer the preparation script and payloads. |
seed | no | Per-build files handed to the guest (agent binary, bootstrap script, answer files, cloud-init data, the build script as build-script), sorted by name. Each entry has name (non-empty), sha256 and size, all required. They are per-build and generally not available to re-check later; their hashes record what the guest was given. |
The encoding is deterministic for a given descriptor (fixed member order, sorted seed).
Metadata
The record's unsigned environment
metadata carries type and driver.
Verify
(1) Hash environment.json against the record; (2) for each layer, hash the
file at path (or a copy obtained elsewhere) and compare sha256 and
size. Disks are never embedded in the ledger.