bmc

Execution module for BMC (Baseboard Management Controller) hardware.

Supports two protocol backends — Redfish and IPMI (via pyghmi) — selected per profile by a backend key. The default is auto, which probes Redfish first and falls back to IPMI. See saltext.bmc.utils.backend for backend selection details.

Configuration via Pillar:

saltext.bmc:
  profiles:
    bmc-host-01:
      host: 10.0.0.5
      username: root
      password: calvin
      verify_ssl: false
      # backend defaults to 'auto'; set explicitly to skip the probe:
      # backend: redfish    # or 'ipmi'
    legacy-host:
      host: 10.0.0.7
      username: ADMIN
      password: ADMIN
      backend: ipmi
      port: 623           # IPMI-only

CLI examples:

salt-call --local bmc.power_status     bmc-host-01
salt-call --local bmc.set_boot_device  bmc-host-01 device=http persistent=False
salt-call --local bmc.power_cycle      bmc-host-01
salt-call --local bmc.get_system_info  bmc-host-01
salt-call --local bmc.get_sensor_data  bmc-host-01

# Bypass pillar with explicit connection kwargs:
salt-call --local bmc.power_status host=10.0.0.5 username=root password=calvin verify_ssl=False
salt-call --local bmc.power_status host=10.0.0.7 username=ADMIN password=ADMIN backend=ipmi
saltext.bmc.modules.bmc.power_status(name: str | None = None, **conn) str[source]

Return the current power state: 'on', 'off', or 'unknown'.

Parameters:

name – BMC profile name (key under saltext.bmc:profiles). Omit to use the top-level saltext.bmc config.

CLI Example:

salt-call --local bmc.power_status bmc-host-01
saltext.bmc.modules.bmc.power_on(name: str | None = None, **conn) dict[source]

Power on the host.

CLI Example:

salt-call --local bmc.power_on bmc-host-01
saltext.bmc.modules.bmc.power_off(name: str | None = None, force: bool = False, **conn) dict[source]

Power off the host.

Parameters:

force – If True, issue ForceOff (hard cut). Otherwise GracefulShutdown is attempted.

CLI Example:

salt-call --local bmc.power_off bmc-host-01
salt-call --local bmc.power_off bmc-host-01 force=True
saltext.bmc.modules.bmc.power_cycle(name: str | None = None, **conn) dict[source]

Power-cycle the host (off then on).

CLI Example:

salt-call --local bmc.power_cycle bmc-host-01
saltext.bmc.modules.bmc.power_reset(name: str | None = None, force: bool = False, **conn) dict[source]

Reset the host. Prefers GracefulRestart; pass force=True for ForceRestart.

CLI Example:

salt-call --local bmc.power_reset bmc-host-01
saltext.bmc.modules.bmc.get_boot_device(name: str | None = None, **conn) dict[source]

Return the current one-shot/persistent boot override.

Returns a dict with keys device (friendly name), redfish_target, native_target, and enabled (Once/Continuous/Disabled). On IPMI backends redfish_target is None.

CLI Example:

salt-call --local bmc.get_boot_device bmc-host-01
saltext.bmc.modules.bmc.set_boot_device(name: str | None = None, device: str = 'none', persistent: bool = False, **conn) dict[source]

Set the boot override.

Parameters:
  • device (str) – One of disk, pxe, http, bios, cd, usb, none. http and usb are not supported by the IPMI backend.

  • persistent (bool) – If True, override persists across reboots (Redfish Continuous). Otherwise it is consumed on the next boot (Once).

CLI Example:

salt-call --local bmc.set_boot_device bmc-host-01 device=http
salt-call --local bmc.set_boot_device bmc-host-01 device=pxe persistent=True
saltext.bmc.modules.bmc.get_system_info(name: str | None = None, **conn) dict[source]

Return a normalised inventory dict.

Keys: manufacturer, model, serial_number, uuid, sku, host_name, bios_version, firmware_version, power_state. Unknown fields are returned as None.

CLI Example:

salt-call --local bmc.get_system_info bmc-host-01
saltext.bmc.modules.bmc.get_sensor_data(name: str | None = None, **conn) dict[source]

Return {"temperatures": [...], "fans": [...], "voltages": [...]}.

Each sensor entry has name, reading, unit, status. A backend may return an empty list for a sensor class it does not expose.

CLI Example:

salt-call --local bmc.get_sensor_data bmc-host-01