22447 Add Cooling infrastructure modeling - #22517
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Historical related issue #6987 useful for searching etc. |
|
Overall a solid keeping the power-model shape. Most deviations from FR #22447 are reasonable simplifications (several requested in review). Notes below, kept short. Decisions
RDHx notes (for whoever picks it up)
Endorsed simplifications (no change requested)
Documentation suggestions
Deferred but acceptable (noted, not blocking)
|
|
@claude /review Only report on issues of potential concern; we don't need commentary on anything that doesn't require further consideration. Also see comments on previous review of Declined requested changes and reasoning. |
|
Claude finished @arthanson's task in 6m 25s —— View job Code Review — 22447 Add Cooling Infrastructure Modeling
All items from the 2026-07-27 review appear to have been addressed. Two remaining concerns follow. 1.
|
|
Per Claudes review:
|
# Conflicts: # netbox/dcim/tests/test_filtersets.py
Closes: #22447
Adds cooling infrastructure modeling to DCIM, mirroring the shape of the power-distribution stack and reusing the standard NetBox model features (contacts and image attachments on the facility plant, plus change logging, custom fields, and tags). This lets operators model liquid- and hybrid-cooled environments (CDUs, manifolds, RDHx, facility plant) as a source of truth.
NetBox models design intent and physical topology, not live conditions — flow and capacity are design/rated specifications, not telemetry.
The topology parallels power, with two deliberate differences:
Cable/CablePathmachinery; tracing a loop is an FK walk.CoolingFeedrepresents both the supply (cold) and return (warm) paths of a single loop, rather than modeling each direction as a separate feed.End-to-end picture
Coolant connectivity is a chain of direct FKs stored on the downstream (consuming) side:
CoolingIntake.cooling_outflowCoolingOutflowCoolingOutflow.cooling_intakeCoolingIntake(same device)A device's serving
CoolingFeedis derived from its rack, not stored on each intake.In-rack equipment (CDUs, manifolds, RDHx) is modeled generically as (typically zero-U)
Devices carrying these components — the same way a PDU is a device with power ports/outlets. No bespoke CDU/manifold/RDHx models were added.New models
fluid_typeand a rated cooling capacity. Reuses contacts and image attachments.CoolingOutflow.CoolingIntakeon the same device.Changes to existing models
cooling_method(air / liquid / hybrid / immersion). ADeviceinherits the value from itsDeviceTypeon creation and may override it (likeairflow);DeviceTypeandModuleTypecarry it as a product-level attribute (ModuleTypemirrorsairflow— type-level only, no per-instance override). On the edit and filter forms,cooling_methodandairfloware grouped under a dedicated Cooling section. Each also gains cooling component counter caches (cooling_intake_count/cooling_outflow_count, or the_template_countvariants on the types).Cablechanges — coolant connectivity is FK-based (CoolingIntake.cooling_outflow,CoolingOutflow.cooling_intake); no new cable type or cable-termination registration.Field conventions on the new cooling models
Several quantities are modeled as value + unit with a normalized field for correct cross-unit sorting (the same pattern as weight). All are design/rated specifications, not live readings:
DiameterMixin).CoolingFeed.rated_flow_rateandCoolingIntake.maximum_flow— L/min / m³/h / GPM, normalized to L/min (MaximumFlowMixin; the feed inlines the same value/unit/normalized pattern).CoolingSource(water / water-glycol / dielectric / refrigerant / other); the whole loop shares it.cooling_capacity) stays single-unit kW — the universal standard for IT cooling load, so no unit selector.Design rationale
CablePath), so connections are direct FKs; individual hoses aren't inventoried.CoolingFeedrepresents the whole loop rather than splitting it into a supply feed and a return feed.CoolingIntakedoesn't store its servingCoolingFeed; the feed is resolved from the device's rack. This avoids a denormalized FK that could drift out of sync when a device is moved.CoolingIntake → CoolingOutflowis many-to-one, so there's no M2M requiring athrough; the intake row is already the per-connection record. A dedicated connection model would only be warranted for multi-source intakes (redundancy is modeled as multiple intakes, like dual-PSU) or physical-hose inventory.Devices rather than rack booleans — mirroring how NetBox has nohas_pdu/has_upsflag. Rack-level liquid readiness is still expressed viaRack.cooling_capability.Deferred (non-schema) decisions
u_height=0) devices, reusing the vertical-PDU pattern. A generic mounting-type field, if wanted, is a DCIM-wide enhancement, not cooling-specific.Data model (fields & relationships)
New models list all declared fields; existing models list only the fields added by this feature.
FK →marks a foreign key;_abs_*are internal columns holding the normalized value (L/min, mm) for consistent sorting/filtering.New models
Existing models — added fields only
Relationships (all foreign keys — no new many-to-many)
A device's serving
CoolingFeedis not a stored FK; it is derived from the device's rack (Rack.cooling_feeds).Scope
Full surface area for every new model: choice sets, filtersets, forms (model/bulk-edit/bulk-import/filter/create), tables, REST API (serializers, viewsets, routes), GraphQL (types, filters, queries), search indexes, navigation (new Cooling menu), UI panels/templates, and database migrations.