Skip to content

Headless fleet installs cannot choose the target disk — select by serial, never by /dev path #979

Closed

Description

@VijitSingh97

What's the problem

A pre-seeded stick can supply the whole configuration, but the disk choice stays with a person. On the installation medium the pre-seed only fills the setup page in; the disk (the erase) is picked and confirmed in the browser. pithead-install --target takes only a raw /dev path, and no pre-seed key names a disk. /dev names reshuffle across boots, so a path is not a safe key; the disk serial is. A fleet stick (#797) that can provision everything except the disk still needs a person per machine.

This changes a documented promise on purpose. docs/appliance.md and the first-boot flow say pre-seeding covers configuration, not the erase decision. For a headless install, a serial the operator wrote on the stick becomes that decision. Everything else about erasing stays as it is.

What it impacts

  • Fleet operators flashing several machines from one stick: no monitor and no browser per box. Standalone installs and the interactive picker are unchanged.
  • Code: os/installer/pithead-install, lib/pithead/10-installer-preseed.sh, lib/pithead/12-firstboot-wizard.sh, docs/appliance.md, the shell tests and one KVM leg. No browser wizard frontend (it is rebuilt under Sovereign: redesign setup token, role and essential configuration steps #2543) and no dashboard UI.
  • Risk: this is an erase path. A wrong match destroys a synced chain (250+ GB), so the refusals below are the substance of the work.

How I found it

Found by the 2026-08-14 repo audit. The operator's 2026-09-23 brief and a re-check against develop on 2026-10-27 agree:

Not confirmed: whether any disk class reports a serial that repeats across two attached disks. Virtio and some NVMe report none, which --list prints as unknown.

How important is it

Low. It matters only at fleet scale; the lean roadmap files it P4 "later, only on demand". It is not a release blocker (no security, data-loss or Tari-fork exposure), and the interactive picker already prevents a wrong-disk wipe on every install path that exists today. It is worked now because the 2026-10-27 owner decision lifts the pause on post-GA work, and the user benefit is concrete: one person provisions a rack without walking a monitor to each machine. It does not gate #797.

Acceptance criteria

  • Opt-in. Only a serial file on the stick's ESP (name chosen in the PR, documented) enables a headless erase. A stick with pithead-config.json and no serial file behaves exactly as today: the pre-filled page opens and waits for a person.
  • Selection. The file holds one or more serials, one per line, matched exactly against the pithead-install --list inventory. The install proceeds only when exactly one attached candidate matches. pithead-install gains --target-serial <serial> that resolves to the same --target path, so every existing guard still runs. The file never supplies a /dev path.
  • Enumeration. With the two disks' /dev order swapped between two runs, the install lands on the disk with the named serial both times and the other disk is untouched.
  • Refusal. Each case below erases nothing, exits non-zero with the reason and the candidate list, and the boot flow then opens the normal setup page:
    • no attached disk matches;
    • more than one attached disk matches;
    • the serial belongs to the booted medium or to a disk with mounted filesystems or swap;
    • the serial is empty, unknown, or contains characters outside the serial alphabet (the file is operator input from a FAT volume and is never interpreted);
    • the pre-seeded pithead-config.json is rejected.
  • Data. A serial file never selects --wipe data or --wipe all. A reinstall onto a disk that already holds a Pithead layout keeps its /data partition.
  • Interactive path unchanged. The disk picker and typed disk-name confirmation behave as today and their existing tests pass.
  • Docs. docs/appliance.md documents the headless flow (file name, format, refusal messages) and no longer says the erase is always a person's decision; the matching claim in the first-boot flow is corrected. No explanatory code comments are added.
  • Proof. A tier-1 shell test with a fake lsblk covers: swapped order, no match, duplicate match, unknown, the boot disk's serial, a mounted disk's serial, a rejected config, and success. A tier4-kvm leg with two disks carrying explicit serials, the target listed second, shows the install on the named disk, the other disk byte-for-byte untouched, and a non-matching serial leaving both untouched ("tier follows the path": a string check is not enough for installer control-plane code).

Possible solutions

  • Recommended by the operator brief: add pithead-install --target-serial <serial> that resolves through the same lsblk JSON list_disks already builds and dies listing the candidates on zero or several matches, then reuses --target. Teach 10-installer-preseed.sh to read an optional serial file from the ESP, sanitised like preseed_token, and have the first-boot flow call the flag before it stages the wizard. No new subsystem and no new installer UI.
  • Settle in the PR (operator recommendations):
  • One serial per stick serves one machine; a list is what lets one stick walk a rack. Decide the list format in the PR.
  • Option if the owner wants a second guard against a stray file: require the serial file to carry an explicit erase word on its first line. It adds a step for fleet operators, so it is left to the owner.
  • Rejected: matching by /dev path (reshuffles) or by model or size (not unique within a fleet).
Earlier scope, kept as evidence only (superseded 2026-10-27; do not implement from it)

What's the problem

Pre-seeding covers the whole config, but disk choice remains human-only: the installer's disk picker is interactive, and there is no headless way to name the target. The design is already written down in the appliance docs — select by disk serial, never by /dev enumeration path (which reshuffles across boots) — but nothing implements it.

Standalone installs don't care. #797 (master installer image, fleet flashing) makes this a real gap: a fleet stick that can provision everything except choose the disk still needs a human per box.

Scope: a `target_disk_serial` (or similar) key in the pre-seed config, honored by `os/installer/pithead-install`, refusing loudly when no attached disk matches. Found by the 2026-08-14 repo audit; named in docs, no prior issue.

what it impacts

Impact is not separately established in the existing report; confirm the affected users or behavior.

How I found it

Discovery details are not separately established in the existing report; preserve and verify the evidence already recorded.

how important is it

Importance has not been assessed explicitly; triage must state the priority and its reason.

acceptance criteria

Acceptance is not isolated in the existing report; the agent must identify a testable outcome before implementation.

possible solutions

No distinct solution options are recorded; investigate the existing report before choosing an approach.

Activity

  1. added this to the v2.x - post-GA milestone on Aug 14, 2026
  2. added
    enhancement
    installer
    appliance
    on Aug 14, 2026
  3. pithead-developer commented on Sep 24, 2026

    @pithead-developer
    Contributor

    Investigation brief (operator pre-read, 2026-09-23)

    Still valid: yes. pithead-install --target still takes only a raw /dev path (os/installer/pithead-install:150-151, :175-179); no serial-based selection exists anywhere in the tree.

    Root cause: list_disks (os/installer/pithead-install:50-63) already extracts each candidate's serial via lsblk/jq for the interactive picker, but that data only reaches a human — publish_disk_inventory (lib/pithead/10-installer-preseed.sh) ships it to the wizard's browser spool, never back into a headless flag. The preseed layer only knows pithead-config.json, pithead-token.txt, pithead-rig.json, pithead-restore.enc/-pass — no target_disk_serial key (confirmed: no target_disk/disk_serial string anywhere in lib/pithead/10-installer-preseed.sh). CHANGELOG 2.0.0 ("which disk to use") and docs/appliance.md:185 both confirm disk choice is still browser-only. The issue's own body (not previously quoted) already states the intended scope precisely: "a target_disk_serial (or similar) key in the pre-seed config, honored by os/installer/pithead-install, refusing loudly when no attached disk matches" — the investigation independently converges on the same shape.

    Note: the CHANGELOG's citation of #924 for "headless config-drop" is stale/wrong — GitHub issue #924 is actually a closed, unrelated bug (setup()'s no-TTY re-run prompt). Drop that citation; the prior-art claim itself (existing preseed_token/consume_preseed_config mechanism) stands on the code alone, no issue number needed.

    Fix shape: add pithead-install --target-serial <serial> that resolves via the same lsblk JSON list_disks already builds, dies loudly listing candidates on zero/multiple matches, then reuses the existing --target path. Teach 10-installer-preseed.sh to read an optional small pithead-disk-serial.txt off the ESP (same pattern as preseed_token) and invoke the new flag. No new subsystem — this thread's existing serial data, wired one more hop.

    Evidence tier: inferred, no PR yet (confirmed via gh pr list/gh search prs — no open or merged PR touches target_disk_serial/disk_serial/target-serial). This is an os/installer control-plane change, so per "tier follows the path" (docs/dev/testing-strategy.md:50) the PR needs a tier4-kvm job proving actual serial resolution + refusal behavior — a tier-1 string check is not enough.

    Rulings needed: (1) preseed key as its own file vs. a pithead-config.json field — recommend own file, mirrors the token split; (2) refuse on serial=="unknown" requests (virtio/some NVMe report none) — recommend yes, always; (3) sequence vs #797 — recommend land #979 first, standalone (#797 still open).

    Duplicates/blockers: none found; #797 (open, master installer image) is a motivator not a blocker; #2068 (closed) added KVM test coverage giving disks real libvirt serial= attributes and explicitly lists #979 as a beneficiary ("this gives it a guest with serials to test against") — worth noting as fresh, directly relevant context the original brief missed, though it doesn't change scope.

    Triage recommendation: no milestone change — #979 is already in "v2.x - post-GA" (set at creation, confirmed via gh issue view), which is frozen until GA per current scope rules; not a GA blocker (no security/data-loss/Tari-fork exposure), and the browser wizard's interactive disk picker already prevents a wrong-disk wipe for every install path that exists today.

    Verify against the code before relying on this; it was written by an investigator, not the implementer.

  4. pithead-developer commented on Oct 27, 2026

    @pithead-developer
    Contributor

    Carried from #797 (closed as shipped): a fleet stick can still not configure a rig without a person. An operator cannot pre-seed the rig role, pool address and worker name ahead of time. The rig pre-seed file (pithead-rig.json on the stick's boot partition) is written only by a disk install, and the first boot rejects it unless it already carries the access token the setup card would have shown. Hand-writing it is undocumented. When #979 designs the headless install path, decide whether rig pre-seeding belongs in the same change, so one stick can walk a rack of rigs with no monitor. Treat it as deferred and low priority, like the rest of this issue.

  5. pithead-developer commented on Nov 1, 2026

    @pithead-developer
    Contributor

    Grouped with #912, but PR #3835 does not close it: Changes the destructive installer disk selection and needs its own installer KVM proof; it shares neither the descriptor gate nor its runtime proof.. Released for its own pick.

  6. pithead-developer commented on Nov 1, 2026

    @pithead-developer
    Contributor

    Waiting on a transient bench_outage condition, not on another issue. tier4-kvm submit (phases=install) on b4188e3 refused twice with '503 draining: the runner is shutting down'; idempotency key 9ff6cfa6e66544739b7ed056da1627ad. The runner re-checks it (first at 2026-11-01T17:27Z, at most 5 times).

  7. pithead-developer commented on Nov 2, 2026

    @pithead-developer
    Contributor

    Blocked on #3844. The only failing required check is Container bridge awk portability (Debian 12). It prints Bridge awk: 45 passed, 0 failed and then make exits 1, because the base branch's test-bridge-awk hard-codes a pass count of 9. That makes it fail on develop-v2.1.0 itself. Issue #3844 tracks it, and the fix is open PR #3845, which hasn't merged. This diff touches no bridge or awk file, so changing it here would be a workaround in the wrong place. Finished and proven on this PR: the Shell lint and Shell tests findings are fixed, and tier4-kvm install passed twice on 0e1942f (jobs 3330 and 3331, evidence blocks in the PR body). Once #3845 merges, merge develop-v2.1.0 into this branch and the check should clear. I posted the same explanation on the PR.

    The runner resumes this issue when that one closes.

  8. added
    blocked
    on Nov 2, 2026
  9. removed
    blocked
    on Nov 2, 2026
  10. added a commit that references this issue on Nov 2, 2026
    b0b0b61
  11. pithead-developer commented on Nov 2, 2026

    @pithead-developer
    Contributor

    Merged in #3837.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    applianceenhancementinstaller

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions