Exclude an external shelf by explicit config, not by path shape

Testing on a second host showed the internal/external split cannot be
inferred: iz-pve1's MD1200 sits behind its own HBA while iz-pve0's
internal drives sit behind a SAS expander, so the previous
"pci-*-scsi-*" glob matched every drive on one host and none on the
other. DISK_EXCLUDE_PATTERN now names the shelf's HBA per host.

Also fixes parse_disk_limit, which used awk's for-in over split fields
and so returned 0 or 70 from "0/70" depending on iteration order.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Zeb Hering
2026-08-28 18:43:20 -07:00
parent 562d8e8d46
commit 64e6e03dba
3 changed files with 34 additions and 8 deletions

View File

@@ -2,7 +2,14 @@
Description=Fan_Speed service
[Service]
ExecStart=/bin/bash -c /root/fan_speed/fan_speed.sh
# Hosts with an external disk shelf must exclude that HBA - the shelf has its
# own cooling and must not drive server fans. Find the PCI address with
# `ls /dev/disk/by-path/`; there is no way to infer it (see monitor.sh).
# iz-pve1 needs this; iz-pve0 has no shelf and needs nothing.
#Environment=DISK_EXCLUDE_PATTERN=pci-0000:04:00.0
ExecStart=/root/fan_speed/fan_speed.sh
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target