Metal Component Specification
Root specification · Behavior: Metal codebase guide
Purpose
Metal manages virtual machines on a host with metald. It does not own the proxy or WG Mesh.
For Go code, follow the repository Go anti-pattern rules.
Layout
text
cmd/metald/ metald executable
cmd/atlas-guest-agent/ agent that VM images install
formal/ PlusCal models checked with TLC: see docs/develop/formal-models.md
internal/ packages, each with a SPEC.md
scripts/ host bootstrap scripts
test/ integration test data
Makefile builds metald and atlas-guest-agent into dist/The module path is github.com/frappe/atlas/metal. Run Go commands from metal/.
Packages
| Package | Owns |
|---|---|
| vm | VM manager, records, and host service interfaces. |
| vm/migration | Live migration and its transport. |
| firecracker | Firecracker runtime and warm starts. |
| api | Thin HTTP handlers. |
| host | Host synchronization and capacity. |
| console | VM serial consoles over PTYs. |
| guestagent | The atlas-guest-agent binary inside each VM. |
| reconciler | VM and image loops. |
| storage | ZFS pool, disks, images, and snapshots. |
| network | VM networks and WireGuard peers. |
| platform | Host files, commands, systemd. |
| telemetry | Metrics push to Datum and the host collector. |
Package imports
| Package | Imports |
|---|---|
cmd/metald | api, host, reconciler, firecracker, storage, network, vm/migration, network/traffic, metrics, telemetry |
cmd/atlas-guest-agent | guestagent |
vm | console, guestagent, metrics, network/traffic, platform |
api | vm, host, console, vm/migration |
host | vm, network, storage, vm/migration |
reconciler | vm, storage, vm/migration |
firecracker | vm, storage, platform, console, guestagent, Firecracker API |
storage | vm, platform |
network | vm, platform, network/traffic |
vm/migration | vm, storage, platform |
network/traffic | cilium eBPF |
api, vm, vm/migration, reconciler, storage, firecracker | telemetry |
telemetry/system | telemetry, platform |
vm must not import vm/migration. It reads migration locks through an injected guard.
Validation
See Metal development. The host layout lists each host file and dataset.