internal: metald packages
For Go code, follow the repository Go anti-pattern rules.
metal SPEC · overview: docs/architecture.md
Purpose
internal/ contains the Metal runtime packages. cmd/metald creates concrete services and injects them into consumers.
The vm package defines the contracts. The other packages implement or consume those contracts.
Packages
| Package | Role |
|---|---|
| vm | VM manager, records, reconciliation, interfaces, and value types. |
| firecracker | Firecracker runtime and optional warm capability. |
| firecracker/api | Firecracker REST client over a Unix socket. |
| api | Authenticated HTTP API. |
| host | Host synchronization and capacity. |
| console | VM serial consoles over PTYs. |
| reconciler | VM state, image cache, warm artifact, and staging cleanup loops. |
| storage | ZFS pool, VM disks, images, and snapshot staging. |
| network | VM namespaces, host rules, managed WireGuard peers, and the unicast transport. |
| network/traffic | eBPF traffic tracking and packet events. |
| platform | Host files, commands, and systemd control. |
| vm/migration | VM live migration: lifecycle, records, and host-to-host transport. |
Dependency graph
Architecture diagram
Loading diagram...
The vm/migration package imports vm. The vm package does not import vm/migration. It reads migration lock state through an injected guard.
The vm package defines small host service interfaces. The vm.Manager owns VM state, operations, and warm-image orchestration.
Related
- metal SPEC routes to concept documents.
- cmd/metald/SPEC.md describes runtime construction.
- docs/architecture.md gives the broad architecture.