Server heights from firmware and model; rack elevation at real size
Nobody types in how many units a server takes. Commissioning reads the SMBIOS chassis height; without one the model decides, from a table of heights checked against vendor documentation (Dell, HPE, Lenovo, xFusion, Fujitsu, Inspur/KAYTUS, GIGABYTE; Supermicro model numbers do not carry the height), and rack_units in config.json covers the rest and overrides both. Sleds of a multi-node chassis share its units. NetBox device types get the height (0 for sleds, which go into the rack without a position; Rollcall's own types are corrected). The rack elevation spans each server over its height, draws a chassis's sleds as one block, marks unknown heights and lists overlaps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
355401465c
commit
9b0b27fce6
12 files changed
+290
-16
No files matched your search
@@ -90,6 +90,13 @@ def dmi_system():
|
||||
# fallbacks via sysfs
|
||||
d["system-uuid"] = d["system-uuid"] or readf("/sys/class/dmi/id/product_uuid")
|
||||
d["system-serial-number"] = d["system-serial-number"] or readf("/sys/class/dmi/id/product_serial")
|
||||
# SMBIOS type 3: the enclosure's height in rack units ("2 U"; often "Unspecified")
|
||||
# and power cords; the region falls back to the model when the height is missing
|
||||
for b in dmi_blocks(3)[:1]:
|
||||
m = re.match(r"(\d+)\s*U\b", b.get("Height", ""))
|
||||
d["chassis-height-u"] = int(m.group(1)) if m else None
|
||||
cords = b.get("Number Of Power Cords", "")
|
||||
d["chassis-power-cords"] = int(cords) if cords.isdigit() else None
|
||||
return d
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user