Skip secondary IOM enclosures with no device-linked slots

Dual-IOM shelves (e.g. NetApp DS2246 with two IOM6 modules) create
two sysfs enclosure entries. The secondary path reports populated
slots via SES but the kernel only links block devices through the
primary path. Filter these out during discovery to avoid showing
ghost enclosures with no drive data.
This commit is contained in:
2026-03-16 22:12:48 +00:00
parent 1b7412c80d
commit 3185acbb24

View File

@@ -51,6 +51,18 @@ def discover_enclosures() -> list[dict]:
slots = list_slots(enc_id)
total = len(slots)
populated = sum(1 for s in slots if s["populated"])
has_devices = any(s["device"] for s in slots)
# Skip secondary/passive IOM paths: enclosures where SES reports
# populated slots but the kernel has no device symlinks for any of
# them (the drives are owned by the primary IOM enclosure entry).
if populated > 0 and not has_devices:
logger.info(
"Skipping enclosure %s (%s %s) — %d populated slots but no "
"device links (likely a secondary IOM path)",
enc_id, vendor, model, populated,
)
continue
enclosures.append({
"id": enc_id,