Model a machine the fleet did not create: no runtime, x86 only, no hardware numbers #13
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/inventory#13
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe a machine the fleet did not create, so a rented internet-facing host can be registered without lying about how it came to exist.
Primary goals:
runtime— and stating one is an error, matching the rule a hypervisor already lives under.x86_64-linuxfor now — refused early and legibly, rather than failing during provisioning.Why this is needed
Every archetype builder reads its machine from
machines.${name}. Two of those fields do not survive contact with a machine the fleet did not provision.runtimenames the virtualisation system running a machine as a guest —libvirttoday — and the framework uses it to select the guest configuration that machine needs. A rented host has no honest answer: some provider's hypervisor runs it, nothing here can see or configure that, and there is no guest module to select.The registry already models this. A hypervisor carries no
runtime, and both directions are enforced: a guest missing one is an error, and a hypervisor carrying one is also an error. So "machine with no runtime" is an existing category rather than a new idea. Nexus is in it because it is bare metal; a rented host joins it for a different reason with the same consequence.Decisions
One —
runtimeis absent for theservicetype, and present is an error. Widen the existing rule from "hypervisors carry no runtime" to "hypervisors and service machines carry no runtime". The rejected alternative was aruntime = "rented"value, which keeps every machine uniform at the cost of putting a fictional virtualisation system in a field that otherwise names real ones — something downstream will eventually try to look up a guest module for.Note for later: this assumes a service is a rented host. A service running as a local guest is imaginable and is deliberately out of scope; when one appears, the decision is whether
servicesplits by where it runs.Two — a
servicemachine'splatformmust bex86_64-linux, refused with a message that explains why.platformis the chip-and-operating-system pair the build targets, checked against the systems Nix exposes; it says nothing about who hosts the machine. Any value Nix knows would pass validation today, ARM included — and then the first ARM machine would fail somewhere confusing during provisioning, because every machine in this fleet is x86 and nothing here has ever built for another chip. Emulation is slow, a separate build machine is a machine, and building on the target needs the target running before it can be configured.The constraint is close to free: x86 is what essentially every provider sells, and ARM is the patchy exception. So the door closes with a message naming the missing cross-architecture build path, and opens deliberately when someone wants it.
Three — no
memory_mb,vcpus,disk_gb, ormac. For a guest these are instructions that the hypervisor acts on. For a rented machine they would be descriptions of what is being paid for, and nothing in the file distinguishes the two. Someone would eventually edit the memory size on a rented host and wonder why nothing happened. If a need for them appears, give them names that cannot be mistaken for the guest fields.Scope
In scope: the schema rules above and fixtures proving each refusal fires.
Not in scope: any actual service machine entry. The first one is added when its host is rented, so the entry describes something real. The rules land first and are exercised by fixtures.
Related: the builder that consumes this is tracked in
allod/archetypes.