From 3185acbb2402f310334b027fd8ae02f8710c9769 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 16 Mar 2026 22:12:48 +0000 Subject: [PATCH] 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. --- services/enclosure.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/enclosure.py b/services/enclosure.py index ad2b8bf..b142200 100644 --- a/services/enclosure.py +++ b/services/enclosure.py @@ -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,