xref: /openbmc/docs/host-management.md (revision 4cd993e2ebeeba49468f485fda6b3e9b6f1cec7b)
198100205SJeremy KerrHost Management with OpenBMC
298100205SJeremy Kerr============================
398100205SJeremy Kerr
498100205SJeremy KerrThis document describes the host-management interfaces of the OpenBMC object
598100205SJeremy Kerrstructure, accessible over REST.
698100205SJeremy Kerr
798100205SJeremy KerrInventory
898100205SJeremy Kerr---------
998100205SJeremy Kerr
1098100205SJeremy KerrThe system inventory structure is under the `/org/openbmc/inventory` hierarchy.
1198100205SJeremy Kerr
1298100205SJeremy KerrIn OpenBMC the inventory is represented as a path which is hierarchical to the
1398100205SJeremy Kerrphysical system topology. Items in the inventory are referred to as inventory
1498100205SJeremy Kerritems and are not necessarily FRUs. If the system contains one chassis, a
1598100205SJeremy Kerrmotherboard, and a CPU on the motherboard, then the path to that inventory item
1698100205SJeremy Kerrwould be:
1798100205SJeremy Kerr
1898100205SJeremy Kerr   inventory/system/chassis0/motherboard0/cpu0
1998100205SJeremy Kerr
2098100205SJeremy KerrThe properties associated with an inventory item are specific to that item with
2198100205SJeremy Kerrthe addition of these common properties:
2298100205SJeremy Kerr
2398100205SJeremy Kerr * `version`: a code version associated with this item
2498100205SJeremy Kerr * `fault`: indicates whether this item has reported an error condition (True/False)
2598100205SJeremy Kerr * `present`: indicates whether this item is present in the system (True/False)
2698100205SJeremy Kerr
2798100205SJeremy KerrThe usual `list` and `enumerate` REST queries allow the system inventory
2898100205SJeremy Kerrstructure to be accessed. For example, to enumerate all inventory items and
2998100205SJeremy Kerrtheir properties:
3098100205SJeremy Kerr
3198100205SJeremy Kerr    curl -b cjar -k https://bmc/org/openbmc/inventory/enumerate
3298100205SJeremy Kerr
3398100205SJeremy KerrTo list the properties of one item:
3498100205SJeremy Kerr
3598100205SJeremy Kerr    curl -b cjar -k https://bmc/org/openbmc/inventory/system/chassis/motherboard
3698100205SJeremy Kerr
3798100205SJeremy KerrSensors
3898100205SJeremy Kerr-------
3998100205SJeremy Kerr
4098100205SJeremy KerrThe system inventory structure is under the `/org/openbmc/sensors` hierarchy.
4198100205SJeremy Kerr
4298100205SJeremy KerrThis interface allows monitoring of system attributes like temperature or
4398100205SJeremy Kerraltitude, and are represented similar to the inventory, by object paths under
4498100205SJeremy Kerrthe top-level `sensors` object name. The path categorizes the sensor and shows
4598100205SJeremy Kerrwhat the sensor represents, but does not necessarily represent the physical
4698100205SJeremy Kerrtopology of the system.
4798100205SJeremy Kerr
4898100205SJeremy KerrFor example, all temperature sensors are under `sensors/temperature`. CPU
4998100205SJeremy Kerrtemperature sensors would be `sensors/temperature/cpu[n]`.
5098100205SJeremy Kerr
5198100205SJeremy KerrThese are the common properties associated all sensors:
5298100205SJeremy Kerr
5398100205SJeremy Kerr * `value`: current value of sensor
5498100205SJeremy Kerr * `units`: units of value
5598100205SJeremy Kerr * `warning_upper` & `warning_lower`: upper & lower threshold for a warning error
5698100205SJeremy Kerr * `critical_upper` & `critical_lower`: upper & lower threshold for a critical error
5798100205SJeremy Kerr * `threshold_state`: current threshold state (normal, warning, critical)
5898100205SJeremy Kerr * `worst_threshold_state`: highest threshold state seen for all time. There is
5998100205SJeremy Kerr   a REST call to reset this state to normal.
6098100205SJeremy Kerr
6198100205SJeremy KerrUnlike IPMI, there are no "functional" sensors in OpenBMC; functional states are
6298100205SJeremy Kerrrepresented in the inventory.
6398100205SJeremy Kerr
6498100205SJeremy KerrTo enumerate all sensors in the system:
6598100205SJeremy Kerr
6698100205SJeremy Kerr    curl -c cjar -k https://bmc/org/openbmc/sensors/enumerate
6798100205SJeremy Kerr
6898100205SJeremy KerrList properties of one inventory item:
6998100205SJeremy Kerr
7098100205SJeremy Kerr    curl -c cjar -k https://bmc/org/openbmc/sensors/temperature/ambient
7198100205SJeremy Kerr
7298100205SJeremy KerrEvent Logs
7398100205SJeremy Kerr----------
7498100205SJeremy Kerr
7598100205SJeremy KerrThe event log structure is under the `/org/openbmc/records/events` hierarchy.
7698100205SJeremy KerrEach event is a separate object under this structure, referenced by number.
7798100205SJeremy Kerr
7898100205SJeremy KerrBMC and host firmware on POWER-based servers can report logs to the BMC.
7998100205SJeremy KerrTypically, these logs are reported in cases where host firmware cannot start the
8098100205SJeremy KerrOS, or cannot reliably log to the OS.
8198100205SJeremy Kerr
8298100205SJeremy KerrThe properties associated with an error log are as follows:
8398100205SJeremy Kerr
8498100205SJeremy Kerr * `Association`: a uri to the failing inventory part
8598100205SJeremy Kerr * `Message`: An English text string indicating the failure
8698100205SJeremy Kerr * `Reported By`: Firmware region that created the log ('Host', 'BMC')
8798100205SJeremy Kerr * `Severity`: level of problem (Info, Predictive Error, etc)
8898100205SJeremy Kerr * `Development Data`: Data dump for use by Development to analyze the failure
8998100205SJeremy Kerr
9098100205SJeremy KerrTo list all reported events:
9198100205SJeremy Kerr
9298100205SJeremy Kerr    $ curl -b cjar -k https://bmc/org/openbmc/records/events/
9398100205SJeremy Kerr    {
9498100205SJeremy Kerr      "data": [
9598100205SJeremy Kerr        "/org/openbmc/records/events/1",
9698100205SJeremy Kerr        "/org/openbmc/records/events/2",
9798100205SJeremy Kerr        "/org/openbmc/records/events/3",
9898100205SJeremy Kerr      ],
9998100205SJeremy Kerr      "message": "200 OK",
10098100205SJeremy Kerr      "status": "ok"
10198100205SJeremy Kerr    }
10298100205SJeremy Kerr
10398100205SJeremy KerrTo read a specific event log:
10498100205SJeremy Kerr
10598100205SJeremy Kerr    $ curl -b cjar -k https://bmc/org/openbmc/records/events/1
10698100205SJeremy Kerr    {
10798100205SJeremy Kerr      "data": {
10898100205SJeremy Kerr        "association": "/org/openbmc/inventory/system/systemevent",
10998100205SJeremy Kerr        "debug_data": [ ... ],
11098100205SJeremy Kerr        "message": "A systemevent has experienced a unrecoverable error",
11198100205SJeremy Kerr        "reported_by": "Host",
11298100205SJeremy Kerr        "severity": "unrecoverable error",
11398100205SJeremy Kerr        "time": "2016:05:04 01:43:57"
11498100205SJeremy Kerr      },
11598100205SJeremy Kerr      "message": "200 OK",
11698100205SJeremy Kerr      "status": "ok"
11798100205SJeremy Kerr    }
11898100205SJeremy Kerr
11998100205SJeremy KerrTo delete an event log (log 1 in his example), call the `delete` method on the event:
12098100205SJeremy Kerr
12198100205SJeremy Kerr    curl -b cjar -k -H "Content-Type: application/json" -X POST \
12298100205SJeremy Kerr        -d '{"data" : []}' \
12398100205SJeremy Kerr        https://bmc/org/openbmc/records/events/1/action/delete
12498100205SJeremy Kerr
12598100205SJeremy KerrTo clear all logs, call the top-level `clear` method:
12698100205SJeremy Kerr
12798100205SJeremy Kerr    curl -b cjar -k -H "Content-Type: application/json" -X POST \
12898100205SJeremy Kerr        -d '{"data" : []}' \
12998100205SJeremy Kerr        https://bmc/org/openbmc/records/events/action/clear
13098100205SJeremy Kerr
13198100205SJeremy KerrBIOS boot options
13298100205SJeremy Kerr-----------------
13398100205SJeremy Kerr
13498100205SJeremy KerrWith OpenBMC, the BIOS boot options are stored as dbus properties under the
13598100205SJeremy Kerr`settings/host0` path, in the `boot_flags` property. Their format adheres to the
13698100205SJeremy KerrBoot Options Parameters table specified in the IPMI Specification Document,
13798100205SJeremy Kerrsection 28.13.
13898100205SJeremy Kerr
13998100205SJeremy KerrEach boot parameter is represented by an individual property, and their hex
14098100205SJeremy Kerrvalue is displayed in a string format. For example, a boot flags parameter value
14198100205SJeremy Kerrof `0x8014000000` would be stored as a `8014000000` string in the
14298100205SJeremy Kerr`settings/host0/boot_flags` property.
143*4cd993e2SJoel Stanley
144*4cd993e2SJoel StanleyHost power control
145*4cd993e2SJoel Stanley------------------
146*4cd993e2SJoel Stanley
147*4cd993e2SJoel StanleyThe host can be controlled through the `chassis` object. It implements a number
148*4cd993e2SJoel Stanleyof actions including powerOn and powerOff. These correspond to the IPMI
149*4cd993e2SJoel Stanley`chassis power on` and `chassis power off` commands.
150*4cd993e2SJoel Stanley
151*4cd993e2SJoel StanleyAssuming you have logged in, the following will issue a POST with an empty data
152*4cd993e2SJoel Stanleypayload that powers the host on:
153*4cd993e2SJoel Stanley
154*4cd993e2SJoel Stanley```
155*4cd993e2SJoel Stanleycurl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST \
156*4cd993e2SJoel Stanley   -d '{"data": []}'  https://bmc/org/openbmc/control/chassis0/action/powerOn
157*4cd993e2SJoel Stanley```
158*4cd993e2SJoel Stanley
159*4cd993e2SJoel StanleyOther actions available are:
160*4cd993e2SJoel Stanley
161*4cd993e2SJoel Stanley * `setIdentify` / `clearIdentify`
162*4cd993e2SJoel Stanley * `powerOff`
163*4cd993e2SJoel Stanley * `softPowerOff`
164*4cd993e2SJoel Stanley * `reboot`
165*4cd993e2SJoel Stanley * `softReboot`
166*4cd993e2SJoel Stanley * `getPowerState`
167