Expand description
§Draupnir — the nordisk boot / provisioning library
Draupnir is the low-level engine that fires up a runtime instance from a
single BootSpec, across three backends, and drives its power lifecycle:
kvm— a KVM/appliance VM, booted by driving tunnr’stunnr_vm::boot_test(BootSpec) -> BootHandleprimitive (featurebackend-tunnr). Draupnir does not reimplement VM boot — it wires theBoottrait against tunnr.container— an OCI container, brought up over a container runtime.redfish— bare metal, provisioned out-of-band through a BMC’s Redfish REST API (iLO / iDRAC / OpenBMC): insert a virtual-media ISO, set the one-time boot override to that media, power the node on. This is the capability Draupnir uniquely owns.
§Where Draupnir sits
Draupnir is the shared low-level boot lib. Two high-level consumers depend on it directly and neither duplicates its boot code:
- jera (edda’s job handler) → depends on Draupnir for job instances
(
process | VM | container). jera stays thin: just job policy. - Skidbladnir (service/systemd, airgap, orchestration) → depends on Draupnir for service instances.
Draupnir itself knows nothing about jobs or services; it just fires up and controls instances. For its KVM backend it calls down into tunnr.
jera ─────────┐
├──▶ Draupnir ──▶ { tunnr (KVM) | OCI runtime | Redfish BMC }
Skidbladnir ──┘§The mythological nod
Draupnir is Odin’s gold ring that drips eight identical copies of itself
every ninth night. Here that is a natural extension, not the core: booting a
fleet of identical machines from one ISO — plan_fleet fans one
BootSpec out into N identical specs (bare-metal fleet provisioning via
Redfish). The core is one library, three boot backends.
Modules§
- container
- Container backend — fire up an OCI container instance (e.g. a redis service) over a container runtime.
- kvm
- KVM backend — fire up an appliance VM by driving tunnr.
- redfish
- Redfish backend — provision bare metal out-of-band through a BMC.
Structs§
- BmcEndpoint
- A BMC (baseboard management controller) endpoint — the out-of-band Redfish service on a bare-metal node (iLO / iDRAC / OpenBMC).
- Boot
Spec - A self-contained boot request. One shape fires up any backend; the
backendselects the driver and [validate] enforces that theimage(and, for Redfish, thebmc) match. - Cloud
Init - cloud-init NoCloud provisioning for a KVM appliance boot: the
user-data(and optionalmeta-data) authored into a small FAT seed image (volume labelcidata) the guest’s cloud-init picks up at first boot. - Machine
- A booted (or booting) instance handle — what a
Boot::bootreturns and whatLifecycleacts on.
Enums§
- Backend
- Which runtime a
BootSpectargets. - Boot
Target - The one-time boot device a Redfish node is overridden to.
- Error
- Everything that can go wrong firing up or controlling an instance.
- Image
Source - The bootable payload — the source an instance is fired up from.
- Power
State - The power state of an instance.
Traits§
- Boot
- Fire up an instance from a
BootSpec. One trait, three implementations (kvm::KvmBoot,container::ContainerBoot,redfish::RedfishBoot). - Lifecycle
- Drive an instance’s power lifecycle after it is fired up.
- Virtual
Media - Redfish virtual-media + boot-override control — the out-of-band steps that
make a bare-metal node boot our ISO. Only the
redfish::RedfishBootbackend implements it; the KVM/container backends have no BMC.
Functions§
- boot
- The unifying entry point — fire up one instance from a
BootSpecacross whichever backend is handed in. Itvalidates the spec first (so a mismatched image/BMC is rejected before any backend is touched), then delegates to the backend’sBoot::boot. The samespecboots the same image on akvm::KvmBoot, acontainer::ContainerBoot, or aredfish::RedfishBoot— one call, three backends. - boot_
fleet - Drip a fleet from one image —
plan_fleetthe spec intonmembers andbooteach throughbackend, returning a per-member result (a partial fleet is observable: some members may boot while a later one errors). - plan_
fleet - The ring drips eight copies — fan one
BootSpecout intonidentical specs, each with a distinct"{name}-{i}"name (1-based), for booting a fleet of identical machines from one image/ISO.
Type Aliases§
- Result
- Draupnir’s result alias.