Skip to content

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

PackageRole
vmVM manager, records, reconciliation, interfaces, and value types.
firecrackerFirecracker runtime and optional warm capability.
firecracker/apiFirecracker REST client over a Unix socket.
apiAuthenticated HTTP API.
hostHost synchronization and capacity.
consoleVM serial consoles over PTYs.
reconcilerVM state, image cache, warm artifact, and staging cleanup loops.
storageZFS pool, VM disks, images, and snapshot staging.
networkVM namespaces, host rules, managed WireGuard peers, and the unicast transport.
network/trafficeBPF traffic tracking and packet events.
platformHost files, commands, and systemd control.
vm/migrationVM 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.

AGPL-3.0