Commit Graph
1 Commits
Author SHA1 Message Date
rock 5fbbe45593 feat(longhorn): add one-shot disk health scan job
SMART self-assessment is not proof a disk is usable. This job writes a
CRC32C-verified pattern across the whole raw device with fio, then reads
every block back and compares. Any unreadable or mismatched sector fails
the Job.

Deliberately NOT an ArgoCD hook: it is destructive, and a PostSync hook
would re-run on every sync and wipe the volume. Apply by hand, once, on a
disk with no partitions and no mounts.

Talos cannot host this. Talos declares disks by mounting them
(machine.disks); it has no primitive to execute a command on the host, so a
scan cannot live in the machine config. A Kubernetes Job is the IaC-correct
home.

Order of operations:
  1. scan the raw device (this job) - disk must be unmounted
  2. add the disk to terraform.tfvars.local longhorn_disks, make apply-cp
  3. register it with Longhorn via longhorn-add-disks-job.yaml

First target: talos-cp-1 /dev/sdb, a 2 TB ST2000LM003 (wwid
naa.50004cf20f5c4c39), currently with no partitions and not mounted.
Measured 124 MB/s write, so budget ~8-9 h for write plus verify.
2026-11-02 12:28:25 +08:00