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:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user