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:
@@ -51,6 +51,18 @@ def discover_enclosures() -> list[dict]:
|
|||||||
slots = list_slots(enc_id)
|
slots = list_slots(enc_id)
|
||||||
total = len(slots)
|
total = len(slots)
|
||||||
populated = sum(1 for s in slots if s["populated"])
|
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({
|
enclosures.append({
|
||||||
"id": enc_id,
|
"id": enc_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user