3. Power operations

This section describes power management operations using the CLI, REST, IPMI and Redfish interfaces.

3.1. BMC command line

You can use the ipum-utils command to control power. Table 3.1 lists the available commands.

Table 3.1 Power control options

Parameter

Description

power_hardoff

Immediately turn off power for the IPU and IPU-Gateway domains, without saving state

power_softoff

Save state and turn off power for the IPU and IPU-Gateway domains

power_hardreset

Safely turn power off and on for all power domains including the connector domain

power_on

Turn on power for the IPU and IPU-Gateway domains

powercap

Show the current power cap setting

To reboot the BMC, use the Linux reboot command.

You can set a limit on the power used by the system with the powercap command, as described below.

$ powercap -h
Usage: powercap
--get-pcap     | -g: Read current power cap from MCP47FEB DAC
--user-pcap    | -p: Print user power cap config setting
--set-pcap     | -s: Set power cap to the specified value in range [600-2600] Watts. Only writes to MCP47FEB DAC volatile registers.
--force-pcap   | -f: Force power cap to the specified value in range [600-2600] Watts. Updates MCP47FEB DAC and and user configs.

Running ipum-utils powercap with no options will display the current setting.

3.2. REST API

You can perform power operations through the REST API either by sending curl queries to the URI or by using the Graphcore openbmctool.py utility.

Table 3.2 describes the available commands.

Table 3.2 Power operations using REST interface

Command

Description

Hard power off

Immediately turn off power for the IPU and IPU-Gateway domains, without saving state

$ curl -k -H "Content-Type: application/json" -X PUT -d '{"data":"xyz.openbmc_project.State.Chassis.Transition.Off"}' https://<bmcuser>:<bmcpass>@<bmcip>/xyz/openbmc_project/state/chassis0/attr/RequestedPowerTransition
$ python3 openbmctool.py -H <bmcip> -U <bmcuser> -P <bmcpass> chassis power hardoff

Soft power off

Save state and turn off power for the IPU and IPU-Gateway domains

$ curl -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.State.Host.Transition.Off"}' https://<bmcuser>:<bmcpass>@<bmcip>/xyz/openbmc_project/state/host0/attr/RequestedHostTransition
$ python3 openbmctool.py -H <bmcip> -U <bmcuser> -P <bmcpass> chassis power softoff

Warm reboot

Soft power off followed by power on

$ curl -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.State.Host.Transition.Reboot"}' https://<bmcuser>:<bmcpass>@<bmcip>/xyz/openbmc_project/state/host0/attr/RequestedHostTransition

No direct openbmtool.py command available. You can use the “soft power off” and “power on” commands instead.

Power on

Turn on power for the IPU and IPU-Gateway domains

$ curl -k -H "Content-Type: application/json" -X PUT -d '{"data": "xyz.openbmc_project.State.Host.Transition.On"}' https://<bmcuser>:<bmcpass>@<bmcip>/xyz/openbmc_project/state/host0/attr/RequestedHostTransition
$ python3 openbmctool.py -H <bmcip> -U <bmcuser> -P <bmcpass> chassis power on

BMC reboot

Reboot the BMC

$ curl -k -H "Content-Type: application/json" -X PUT -d '{"data":"xyz.openbmc_project.State.BMC.Transition.Reboot"}' https://<bmcuser>:<bmcpass>@<bmcip>/xyz/openbmc_project/state/bmc0/attr/RequestedBMCTransition
$ python3 openbmctool.py -H <bmcip> -U <bmcuser> -P <bmcpass> bmc reset

You can manage power consumption using the REST interface with the commands in Table 3.3.

Table 3.3 Power consumption management using REST interface

Command

Description

Power cap status

Get current settings

$ python3 openbmctool.py -H <bmcip> -U <bmcuser> -P <bmcpass> chassis chassis pcap -g
Attempting login...
Chassis PowerCap State: {'PowerCap': 2400, 'PowerCapEnable': False}
User root has been logged out

Set power cap

Set new power cap value

$ python3 openbmctool.py -H <bmcip> -U <bmcuser> -P <bmcpass> chassis pcap -s  <600-2600>
Attempting login...
Attempting to disable power cap ...
User root has been logged out

Disable power cap

Disable power capping

$ python3 openbmctool.py -H <bmcip> -U <bmcuser> -P <bmcpass> chassis pcap -d

3.3. IPMI

Table 3.4 describes the ipmitool power-related commands that are available.

Table 3.4 Power operations using IPMI interface

Command

Description

Hard power off

Immediately turn off power for the IPU and IPU-Gateway domains, without saving state

$ ipmitool -I lanplus -C 3 -p 623 -U <bmcuser> -P <bmcpass> -H <bmcip> power off

Soft power off

Save state and turn off power for the IPU and IPU-Gateway domains

$ ipmitool -I lanplus -C 3 -p 623 -U <bmcuser> -P <bmcpass> -H <bmcip> power soft

Warm reboot

Soft power off followed by power on

$ ipmitool -I lanplus -C 3 -p 623 -U <bmcuser> -P <bmcpass> -H <bmcip> power reset

Power on

Turn on power for the IPU and IPU-Gateway domains

$ ipmitool -I lanplus -C 3 -p 623 -U <bmcuser> -P <bmcpass> -H <bmcip> power on

BMC reboot

Reboot the BMC

$ ipmitool -I lanplus -C 3 -p 623 -U <bmcuser> -P <bmcpass> -H <bmcip> bmc reset cold

You can manage power consumption using the IPMI interface with the commands in Table 3.5.

Table 3.5 Power consumption management using IPMI interface

Command

Description

Power cap status

Get current settings

$ ipmitool -I lanplus -C 3 -p 623 -U <bmcuser> -P <bmcpass> -H <bmcip> dcmi power get_limit
Current Limit State: No Active Power Limit0
Exception actions:   Hard Power Off & Log Event to SEL
Power Limit:         2200 Watts
Correction time:     0 milliseconds
Sampling period:     0 seconds

Set power cap

Set new power cap value

$ ipmitool -I lanplus -C 3 -p 623 -U <bmcuser> -P <bmcpass> -H <bmcip> dcmi power set_limit limit 2100
Current Limit State: No Active Power Limit0
Exception actions:   Hard Power Off & Log Event to SEL
Power Limit:         2100 Watts
Correction time:     0 milliseconds
Sampling period:     0 seconds

Enable power cap

Enable power capping

$ ipmitool -I lanplus -C 3 -p 623 -U <bmcuser> -P <bmcpass> -H <bmcip> dcmi power activate
Power limit successfully activated

Disable power cap

Disable power capping

$ ipmitool -I lanplus -C 3 -p 623 -U <bmcuser> -P <bmcpass> -H <bmcip> dcmi power deactivate
Power limit successfully deactivated

3.4. Redfish

You can see the supported power operations at https://<bmcip>/redfish/v1/Systems/system. Table 3.6 describes the power operations.

Table 3.6 Power operations using Redfish interface

Command

Description

Hard power off

Immediately turn off power for the IPU and IPU-Gateway domains, without saving state

$ curl -k -H "X-Auth-Token: <token>" -X POST https://${bmcip}/redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "ForceOff"}' -u <bmcpass>:<bmcuser>

Soft power off

Save state and turn off power for the IPU and IPU-Gateway domains

$ curl -k -H "X-Auth-Token: <token>" -X POST https://${bmcip}/redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "GracefulShutdown"}' -u <bmcpass>:<bmcuser>

Warm reboot

Soft power off followed by power on

$ curl -k -H "X-Auth-Token: <token>" -X POST https://${bmcip}/redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "GracefulRestart"}' -u <bmcpass>:<bmcuser>

Power on

Turn on power for the IPU and IPU-Gateway domains

$ curl -k -H "X-Auth-Token: <token>" -X POST https://${bmcip}/redfish/v1/Systems/system/Actions/ComputerSystem.Reset -d '{"ResetType": "ForceOn"}' -u <bmcpass>:<bmcuser>