ManagementControllerDriver: a role base for server BMCs #31

Open
opened 2026-10-12 23:18:17 +00:00 by christianmanivong · 1 comment
Owner

A new role base for server management controllers (BMCs: Supermicro, Dell iDRAC, HPE iLO, Lenovo XCC), needed by the planned napalm-redfish driver (https://git.netork.io/NAPALM/napalm-redfish). Whether netOrk models BMCs this way is decided in NetOrk/netork#1095; this issue is the napalm-device-types side once it is.

Why a new role

The existing role bases describe what a device is. A BMC is a separate computer with its own port, IP and MAC that manages another machine, whatever OS that machine runs. None of the contracts fits, and borrowing OSDriver would make netOrk offer package updates and service control for a BMC.

Draft

class ManagementControllerDriver(DeviceTypeDriver):
    """Contract, not code."""
    ROLE: str = "management_controller"
    TYPE_LABEL: str = "Management Controller"
    USES_SSH: bool = False

    if TYPE_CHECKING:
        # the managed machine
        def get_power_state(self) -> PowerStateDict: ...
        def set_power_state(self, action: PowerAction) -> None: ...
        def get_hardware_inventory(self) -> HardwareInventoryDict: ...
        def get_event_log(self, limit: int = 500) -> List[EventLogEntryDict]: ...
        # the controller itself
        def get_firmware_inventory(self) -> List[FirmwareDict]: ...
        def get_management_protocols(self) -> ManagementProtocolsDict: ...

PowerAction: On, GracefulShutdown, ForceOff, GracefulRestart, ForceRestart, PowerCycle (the Redfish ResetType values netOrk would offer).

Points to settle here

  1. reboot_host means the BMC. HostRebootMixin says a driver restarts its own host, never one it manages. For a BMC that is the controller reset (Redfish Manager.Reset); the server goes through set_power_state. The docstring should say so for this role.
  2. Sensors. NAPALM's get_environment has fans, temperatures and PSUs but also requires CPU and memory, which a BMC does not know for the host OS. Either get_environment with those empty, or a get_sensors that also carries voltages and power draw.
  3. No HealthMetricsMixin. That mixin is SNMP/UCD-MIB; BMC health comes from Redfish. A driver that needs get_health_metrics implements it, as SwitchDriver drivers do.
  4. CommandChannelMixin (inherited through DeviceTypeDriver) stays unimplemented: no shell.
  5. Write capability by hasattr. The read-only IPMI fallback (ipmi entry point) simply does not define set_power_state.
  6. Models in models.py: PowerStateDict, HardwareInventoryDict, EventLogEntryDict, FirmwareDict, ManagementProtocolsDict.
  7. Fingerprint. An unauthenticated GET /redfish/v1/ returns the service root on every Redfish BMC, a vendor-neutral PORT_SPECS/HTTP_FINGERPRINT rule.
  8. Host link data. The contract should expose what netOrk needs to match a BMC to its host: the server's serial, system UUID and NIC MACs (from get_hardware_inventory).

Full draft and context: docs/role.md in napalm-redfish.

Priority: P4 (follows NetOrk/netork#1095, which is P4).

A new role base for server management controllers (BMCs: Supermicro, Dell iDRAC, HPE iLO, Lenovo XCC), needed by the planned `napalm-redfish` driver (https://git.netork.io/NAPALM/napalm-redfish). Whether netOrk models BMCs this way is decided in NetOrk/netork#1095; this issue is the napalm-device-types side once it is. ## Why a new role The existing role bases describe what a device *is*. A BMC is a separate computer with its own port, IP and MAC that manages *another* machine, whatever OS that machine runs. None of the contracts fits, and borrowing `OSDriver` would make netOrk offer package updates and service control for a BMC. ## Draft ```python class ManagementControllerDriver(DeviceTypeDriver): """Contract, not code.""" ROLE: str = "management_controller" TYPE_LABEL: str = "Management Controller" USES_SSH: bool = False if TYPE_CHECKING: # the managed machine def get_power_state(self) -> PowerStateDict: ... def set_power_state(self, action: PowerAction) -> None: ... def get_hardware_inventory(self) -> HardwareInventoryDict: ... def get_event_log(self, limit: int = 500) -> List[EventLogEntryDict]: ... # the controller itself def get_firmware_inventory(self) -> List[FirmwareDict]: ... def get_management_protocols(self) -> ManagementProtocolsDict: ... ``` `PowerAction`: `On`, `GracefulShutdown`, `ForceOff`, `GracefulRestart`, `ForceRestart`, `PowerCycle` (the Redfish `ResetType` values netOrk would offer). ## Points to settle here 1. **`reboot_host` means the BMC.** `HostRebootMixin` says a driver restarts its own host, never one it manages. For a BMC that is the controller reset (Redfish `Manager.Reset`); the server goes through `set_power_state`. The docstring should say so for this role. 2. **Sensors.** NAPALM's `get_environment` has fans, temperatures and PSUs but also requires CPU and memory, which a BMC does not know for the host OS. Either `get_environment` with those empty, or a `get_sensors` that also carries voltages and power draw. 3. **No `HealthMetricsMixin`.** That mixin is SNMP/UCD-MIB; BMC health comes from Redfish. A driver that needs `get_health_metrics` implements it, as `SwitchDriver` drivers do. 4. **`CommandChannelMixin`** (inherited through `DeviceTypeDriver`) stays unimplemented: no shell. 5. **Write capability by `hasattr`.** The read-only IPMI fallback (`ipmi` entry point) simply does not define `set_power_state`. 6. **Models** in `models.py`: `PowerStateDict`, `HardwareInventoryDict`, `EventLogEntryDict`, `FirmwareDict`, `ManagementProtocolsDict`. 7. **Fingerprint.** An unauthenticated `GET /redfish/v1/` returns the service root on every Redfish BMC, a vendor-neutral `PORT_SPECS`/`HTTP_FINGERPRINT` rule. 8. **Host link data.** The contract should expose what netOrk needs to match a BMC to its host: the server's serial, system UUID and NIC MACs (from `get_hardware_inventory`). Full draft and context: `docs/role.md` in napalm-redfish. Priority: P4 (follows NetOrk/netork#1095, which is P4).
Author
Owner

Decided in NetOrk/netork#1095 (2026-10-13): this role base is going ahead.

Decided in NetOrk/netork#1095 (2026-10-13): this role base is going ahead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-device-types#31