saltext.bmc.utils.ipmi

IPMI transport for the saltext-bmc extension.

Thin wrapper over pyghmi.ipmi.command.Command. pyghmi is an optional dependency — install with pip install saltext.bmc[ipmi]. The module imports it lazily so the extension still loads in Redfish-only environments.

This module exposes a uniform interface that mirrors the Redfish one in saltext.bmc.utils.redfish, taking canonical action / boot-device names and translating them to IPMI semantics:

Canonical action

IPMI translation

On

set_power('on')

ForceOff

set_power('off')

GracefulShutdown

set_power('shutdown')

PowerCycle

IPMI chassis control 0x02

GracefulRestart

set_power('reset')

ForceRestart

set_power('reset')

Canonical boot device

pyghmi bootdev

disk

hd

pxe

network

bios

setup

cd

cd

none

default

http / usb

not supported (raises)

exception saltext.bmc.utils.ipmi.IpmiError[source]

An IPMI operation failed.

exception saltext.bmc.utils.ipmi.IpmiAuthError[source]

Authentication against the IPMI endpoint failed.

class saltext.bmc.utils.ipmi.IpmiClient(host: str, username: str, password: str, *, port: int = 623, timeout: int = 30)[source]

Thin IPMI client wrapping pyghmi.ipmi.command.Command.

Use as a context manager:

with IpmiClient(host, user, password) as c:
    state = c.power_status()