Files
nix-config/hosts/idols-ai
ryan4yin | 二花 dc3ec8c159 feat(storage): relax ai NVMe workarounds and add drive SMART monitoring (#359)
* fix(ai): relax NVMe power-management workarounds and enable smartd

Logs show no NVMe errors, so allow APST again (capped at 100 ms), restore
the default io_timeout, and drop pcie_aspm=off. Add smartd for drive
health visibility.

* feat(storage): add drive/SSD SMART monitoring on physical hosts

node_exporter's nvme collector only exposes node_nvme_info and namespace
capacity, not SMART health, so SSD wear/lifespan and drive temperature were
not observable anywhere.

- enable services.prometheus.exporters.smartctl on physical hosts, gated on
  modules.hardwareTools (off on QEMU/MicroVM guests), bound to the host's LAN
  address on port 9633
- firewall: drop 9633 from anything but the monitoring host
- youko: scrape smartctl-<host> for the physical hosts
- alert rules (storage.yml): SMART health, NVMe wear, available spare, media
  errors, critical warning, and drive temperature (warn 70 / crit 80 C)
- Grafana dashboard "Drive SMART (smartctl)"
2026-10-03 11:13:46 +08:00
..
2026-02-16 21:35:39 +08:00

Host - AI

Desktop (NixOS + preservation, LUKS + btrfs on nvme). Disk layout is declarative via disko (target device: nvme1n1).

Related:

  • nixos-installer README – install from ISO using disko
  • disko-fs.nix – main disk layout (ESP + LUKS + btrfs). From nix-config/nixos-installer:
    nix run github:nix-community/disko -- --mode destroy,format,mount ../hosts/idols-ai/disko-fs.nix
  • disko-fs-data.nix – data disk layout (LUKS + btrfs at /data)

TODOs

  1. Install DCGM-Exporter on ai to monitor the GPU status.

Info

The disk layout is fully declarative — see disko-fs.nix for the root disk and disko-fs-data.nix for the data disk. Run df -Th / lsblk on the host if an up-to-date snapshot of the current mounts is needed.