Dedicated data disks: whole-disk longhorn/rancher volumes by stable by-id path #18
Reference in New Issue
Block a user
Delete Branch "feat/dedicated-data-disks"
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?
Multi-disk support for the v2 layout, built for converting thebeast into a prod
k8s-worker(1 TB OS + 2 TB longhorn + 2 TB rancher). Until now every generator was single-disk (ignoredisk --only-use=$DISK, one VG).What's new
Shared layout (v2 only)
DataDisks { longhorn?, rancher? }—/dev/disk/by-idpaths ONLY (nvme kernel names are not stable across boots on multi-NVMe hosts; a swapped name formats the wrong disk)v2Layout()drops the LV whose mount a dedicated disk suppliesvalidateDataDisks()shared by the HTTP API, the websocket command handler and the CLI: by-id enforced, capability-gated (no longhorn disk on a control-plane-only node, no rancher disk without k3s), no double-booking one diskFedora kickstart (the only generator extended;
dataDiskson ubuntu/vyos are rejected, never silently dropped)%preresolves each by-id path to tonight's kernel name; a missing disk fails loudly instead of continuing single-disklab-longhorn/lab-rancher(--growis correct here: consuming the disk is the point)lab-schema-v2VG tag: a reprovision rediscovers labelled disks with no flags and mounts them--noformat; a fresh install refuses to wipe or shadow a labelled disk it was not told about; a label on the wrong disk, or a data LV coexisting with a dedicated disk, aborts rather than guesses--disknow also accepts a by-id path, and OS-disk auto-detect can never pick a data diskPlumbing:
InstallConfig.dataDisks,/api/installvalidation,labctl provision install --longhorn-disk/--rancher-disk, labd forwarding. Also fixes a latent bug: the labdcommand-installpath silently droppedschemaVersion(an explicit--schema-version 2on a legacy role became v1 on the far side).Runbook:
migration/THEBEAST-K8S-WORKER.md— disk map by serial, what still needs copying off the degraded (zero-redundancy) rpool, VLAN move, the exactlabctlcommand, k8s0 join with the CI/CD taint.Verification
data-disks.test.ts: validator, layout, render, full/api/install → /ksplumbing)tsc --buildclean; no new lint errors in touched files (diffed against main)bastion/tests/integration/data-disks.test.ts, run on thebeast; evidence inmigration/drill-evidence/data-disks-2026-10-14.txt): a real PXE install with 2 data disks lands the exact layout (no longhorn/rancher LVs, labelled whole-disk xfs on the serial-matched disks), and a flagless reprovision rediscovers both by label and remounts them unformatted — filesystem UUIDs identical before/after, marker files intact in all four preserved mounts. Harness grewdataDisksVM support, an SSH-timeout post-mortem (serial console + domstate in the failure),KEEP_VMS=1, andLAB_TEST_SSH_KEY(a passphrase-protected default key fails as a fake "machine never came up").🤖 Generated with Claude Code
https://claude.ai/code/session_01V6HNx6cyr4J4CiMGCy1wkF
A machine with spare NVMe bays (thebeast: 1TB OS + 2TB + 2TB) wants the opposite trade from the fixed 250G/300G LVs that exist to FIT a 1TB disk: give /var/lib/longhorn and /var/lib/rancher a whole disk each and keep the OS VG small. Until now every generator was single-disk (ignoredisk --only-use=$DISK, one VG) and had no way to say that. New in the shared layout (v2 only): - DataDisks { longhorn?, rancher? }: /dev/disk/by-id paths ONLY, because nvme0n1/nvme1n1 enumeration is not stable across boots on multi-NVMe hosts and a swapped kernel name formats the wrong disk. - v2Layout() drops the LV whose mount a dedicated disk supplies. - validateDataDisks() shared by HTTP API, websocket handler and CLI, so all three reject with the same words: by-id enforced, capability-gated (no longhorn disk on a control-plane-only node, no rancher disk without k3s), no double-booking one disk. Fedora kickstart (the only generator extended; dataDisks on ubuntu/vyos are rejected, not dropped): - %pre resolves each by-id path to tonight's kernel name; a missing disk fails the install loudly instead of continuing single-disk. - Fresh disk: ONE xfs partition spanning it, labelled lab-longhorn / lab-rancher. --grow is correct here -- consuming the disk is the point, unlike LVs competing inside a shared VG. - The label is on-disk truth, exactly like the lab-schema-v2 VG tag: a reprovision rediscovers labelled disks via blkid with NO flags and mounts them --noformat; a fresh install refuses to wipe or shadow a labelled disk it was not told about; a label on the wrong disk, or a data LV coexisting with a dedicated disk, aborts rather than guesses. - --disk now also accepts a by-id path (resolved in %pre), and auto-detect can never pick a data disk as the OS disk. Plumbing: InstallConfig.dataDisks, POST /api/install validation, labctl provision install --longhorn-disk/--rancher-disk, labd forwarding. The labd command-install path also silently DROPPED schemaVersion (an explicit --schema-version 2 on a legacy role became v1 on the far side); it now travels with dataDisks in the protocol message. migration/THEBEAST-K8S-WORKER.md is the concrete runbook: disk map by serial, data still to copy off the degraded (zero-redundancy) rpool, VLAN move, the exact labctl command, and the k8s0 join with CI/CD taint. 569 tests pass (34 new), tsc --build clean, no new lint errors. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V6HNx6cyr4J4CiMGCy1wkFEvery job on main has been failing at setup: pnpm/action-setup@v4 reads packageManager from the package.json at the REPO ROOT, and a job-level working-directory default does not apply to `uses:` steps, so the pin in bastion/package.json was never seen ("No pnpm version is specified"). Point the action at bastion/package.json so the version stays declared in exactly one place. Past setup, typecheck/test/build would then hit the next wall: labd's generated Prisma client does not exist after a fresh install (no postinstall hook, by design), and tsc --build fails on it. Run `pnpm -C src/labd run db:generate` right after install in the jobs that compile. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V6HNx6cyr4J4CiMGCy1wkFip route