nixos/cellar: Keep spdk-tgt running on deploy

Restarting `spdk-tgt` takes every NVMe-oF root disk away (river,
castle, sfh), so don't do it on deploy.

`spdk-debug` repeated the RAID definition by hand. Generate its config
from the real one instead (no examine, no exports, ublk disks from
`my.spdk.debug.ublkDisks`), so it can't drift and runs without a
terminal. Document adding a partition export with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 22:01:54 +00:00
co-authored by Claude Opus 5.5
parent 5fb8e8d280
commit 5058dec3f1
3 changed files with 102 additions and 26 deletions
+2 -9
View File
@@ -14,15 +14,8 @@ in
spdk = {
enable = true;
extraArgs = "--mem-channels 2 --cpumask 0xffff";
debugCommands = ''
spdk-rpc bdev_nvme_attach_controller -t pcie -a 02:00.0 -b NVMe0
spdk-rpc bdev_nvme_attach_controller -t pcie -a 03:00.0 -b NVMe1
spdk-rpc bdev_nvme_attach_controller -t pcie -a 04:00.0 -b NVMe2
spdk-rpc bdev_raid_create -n NVMeRaid -z 64 -r 0 -b 'NVMe0n1 NVMe1n1 NVMe2n1'
spdk-rpc ublk_create_target
spdk-rpc ublk_start_disk NVMeRaid 1
'';
# `spdk-debug` exposes the RAID as /dev/ublkb1 (e.g. to edit its partition table)
debug.ublkDisks = [ "NVMeRaid" ];
config.subsystems =
let
nvmeAttaches = mapAttrsToList (name: bdf: {