1b1b4d261SWilliam A. Kennington III# BMC, Host, and Chassis State Management 2b1b4d261SWilliam A. Kennington III 3b1b4d261SWilliam A. Kennington III## Overview 4b1b4d261SWilliam A. Kennington III 5b1b4d261SWilliam A. Kennington IIIThe goal of the phosphor-state-manager repository is to control and track the 6b1b4d261SWilliam A. Kennington IIIstates of the different software entities in a system. All users will usually 7b1b4d261SWilliam A. Kennington IIIimplement the BMC state interfaces, and some, when creating servers will do the 8b1b4d261SWilliam A. Kennington IIIHost and Chassis state interfaces. These interfaces will be the mechanism by 9b1b4d261SWilliam A. Kennington IIIwhich you determine the state of their corresponding instances, as well as 10b1b4d261SWilliam A. Kennington IIIreboot the BMC and hosts, and turn on and off power to the chassis. The 11b1b4d261SWilliam A. Kennington IIIinterfaces are designed in a way to support a many to many mappings of each 12b1b4d261SWilliam A. Kennington IIIinterface. 13b1b4d261SWilliam A. Kennington III 14b1b4d261SWilliam A. Kennington IIIThere are three states to track and control on a BMC based server. The states 15b1b4d261SWilliam A. Kennington IIIbelow in () represent the actual parameter name as found in 16b1b4d261SWilliam A. Kennington III`/xyz/openbmc_project/state/`+`/bmcX,/hostY,/chassisZ` where X,Y,Z are the 17*a1347418SPatrick Williamsinstances (in most cases 0). For all three states, the software tracks a current 18*a1347418SPatrick Williamsstate, and a requested transition. 19b1b4d261SWilliam A. Kennington III 20388b58f9SPatrick Williams1. _BMC_ : The BMC has either started all required systemd services and reached 21b1b4d261SWilliam A. Kennington III it's required target (Ready) or it's on it's way there (NotReady). Users can 22b1b4d261SWilliam A. Kennington III request a (Reboot). 23b1b4d261SWilliam A. Kennington III 24*a1347418SPatrick Williams2. _Host_ : The host is either (Off), (Running), or it's (Quiesced). Running 25*a1347418SPatrick Williams simply implies that the processors are executing instructions. Users can 26*a1347418SPatrick Williams request the host be in a (Off), (On), or (Reboot) state. More details on 27*a1347418SPatrick Williams different Reboot options below. Quiesced means the host OS is in a quiesce 28*a1347418SPatrick Williams state and the system should be checked for errors. For more information refer 29*a1347418SPatrick Williams to [Error Handling of systemd][1]. 30b1b4d261SWilliam A. Kennington III 31*a1347418SPatrick Williams3. _Chassis_ : The chassis is either (Off) or (On) This represents the state of 32*a1347418SPatrick Williams power to the chassis. The Chassis being on is a pre-req to the Host being 33*a1347418SPatrick Williams running. Users can request for the chassis to be (Off) or (On). A transition 34*a1347418SPatrick Williams to one or the other is implied by the transition not matching the current 35*a1347418SPatrick Williams state. 36b1b4d261SWilliam A. Kennington III 37388b58f9SPatrick WilliamsA simple system design would be to include a single _BMC_, _Host_, and 38388b58f9SPatrick Williams_Chassis_. 39b1b4d261SWilliam A. Kennington III 40b1b4d261SWilliam A. Kennington IIIDetails of the properties and their valid settings can be found in the state 41388b58f9SPatrick Williamsmanager dbus interface [specification][2]. 42b1b4d261SWilliam A. Kennington III 43b1b4d261SWilliam A. Kennington III### BMC 44b1b4d261SWilliam A. Kennington III 45*a1347418SPatrick WilliamsThe _BMC_ would provide interfaces at `/xyz/openbmc_project/state/bmc<instance>` 46b1b4d261SWilliam A. Kennington III 47388b58f9SPatrick Williams### _Host_ 48b1b4d261SWilliam A. Kennington III 49388b58f9SPatrick WilliamsThe _Host_ would provide interfaces at 50b1b4d261SWilliam A. Kennington III`/xyz/openbmc_project/state/host<instance>` 51b1b4d261SWilliam A. Kennington III 52388b58f9SPatrick Williams### _Chassis_ 53b1b4d261SWilliam A. Kennington III 54388b58f9SPatrick WilliamsThe _Chassis_ would provide interfaces at 55b1b4d261SWilliam A. Kennington III`/xyz/openbmc_project/state/chassis<instance>` 56b1b4d261SWilliam A. Kennington III 57388b58f9SPatrick Williams### _Chassis System_ 58388b58f9SPatrick Williams 59388b58f9SPatrick WilliamsThis is an instance under _Chassis_ and provide interface at 60b1b4d261SWilliam A. Kennington III`/xyz/openbmc_project/state/chassis_system<instance>` 61b1b4d261SWilliam A. Kennington III 62*a1347418SPatrick WilliamsInstance 0 (chassis_system0) will be treated as a complete chassis system which 63*a1347418SPatrick Williamswill include BMC, host and chassis. This will support hard power cycle of 64*a1347418SPatrick Williamscomplete system. 65b1b4d261SWilliam A. Kennington III 66*a1347418SPatrick WilliamsIn multi-host or multi-chassis system, instance number can be used from 1-N, as 67*a1347418SPatrick Williams0 is reserved for complete system. In multi chassis system this can be named as 68*a1347418SPatrick Williamschassis_system1 to chassis_systemN 69b1b4d261SWilliam A. Kennington III 70b1b4d261SWilliam A. Kennington III## BMC to Host to Chassis Mapping 71b1b4d261SWilliam A. Kennington III 72*a1347418SPatrick WilliamsIn the future, OpenBMC will provide an association API, which allows one to 73*a1347418SPatrick Williamsprogrammatically work out the mapping between BMCs, Chassis and Hosts. 74b1b4d261SWilliam A. Kennington III 75b1b4d261SWilliam A. Kennington IIIIn order to not introduce subtle bugs with existing API users, `bmc0`, 76b1b4d261SWilliam A. Kennington III`chassis0` and `host0` are special. If they exist, they are guaranteed to talk 77*a1347418SPatrick Williamsto the system as a whole as if it was a system with one BMC, one chassis and one 78*a1347418SPatrick Williamshost. If there are multiple hosts, then bmc0/chassis0/host0 will _not_ exist. In 79*a1347418SPatrick Williamsthe event of multiple BMCs or Chassis, bmc0 and chassis0 will act on all 80*a1347418SPatrick Williamsentities as if they are one (if at all possible). 81b1b4d261SWilliam A. Kennington III 82*a1347418SPatrick WilliamsThis behaviour means that existing code will continue to work, or error out if 83*a1347418SPatrick Williamsthe request would be ambiguous and probably not what the user wanted. 84b1b4d261SWilliam A. Kennington III 85b1b4d261SWilliam A. Kennington IIIFor example, if a system has two chassis, only powering off the first chassis 86388b58f9SPatrick Williams(while leaving the second chassis on) is certainly _not_ what the API user had 87b1b4d261SWilliam A. Kennington IIIin mind as they likely desired to hard power off the system. In such a 88b1b4d261SWilliam A. Kennington IIImulti-chassis system, starting counting from 1 rather than 0 would avoid this 89388b58f9SPatrick Williamsproblem, while allowing an API user to _intentionally_ only power off one 90b1b4d261SWilliam A. Kennington IIIchassis. With chassis0 being special, it would allow existing code to continue 91b1b4d261SWilliam A. Kennington IIIto function on this multi-chassis system. 92b1b4d261SWilliam A. Kennington III 93b1b4d261SWilliam A. Kennington IIIFor example, a system with multiple hosts would have BMCs, Chassis and Hosts 94*a1347418SPatrick Williams_all_ start numbering from 1 rather than 0. This is because multiple hosts could 95*a1347418SPatrick Williamsbe in the same chassis, or controlled by the same BMC, so taking action against 96*a1347418SPatrick Williamsthem would _not_ be what the API user intended. 97b1b4d261SWilliam A. Kennington III 98*a1347418SPatrick WilliamsIt is safe to continue to write code referencing bmc0, host0 and chassis0 and 99*a1347418SPatrick Williamsthat code will continue to function, or error out rather than doing something 100*a1347418SPatrick Williamsundesirable. 101b1b4d261SWilliam A. Kennington III 102b1b4d261SWilliam A. Kennington III## Hard vs. Soft Power Off 103b1b4d261SWilliam A. Kennington III 104*a1347418SPatrick WilliamsA hard power off is where you simply cut power to a chassis. You don't give the 105*a1347418SPatrick Williamssoftware running on that chassis any chance to cleanly shut down. A soft power 106*a1347418SPatrick Williamsoff is where you send a notification to the host that is running on that chassis 107*a1347418SPatrick Williamsthat a shutdown is requested, and wait for that host firmware to indicate it has 108*a1347418SPatrick Williamsshut itself down. Once complete, power is then removed from the chassis. By 109*a1347418SPatrick Williamsdefault, a host off or reboot request does the soft power off. If a user desires 110*a1347418SPatrick Williamsa cold reboot then they should simply issue a power off transition request to 111*a1347418SPatrick Williamsthe chassis, and then issue an on transition request to the host. 112b1b4d261SWilliam A. Kennington III 113b1b4d261SWilliam A. Kennington III## Operating System State and Boot Progress Properties 114b1b4d261SWilliam A. Kennington III 115*a1347418SPatrick Williams[OperatingSystemState][3] property is used to track different progress states of 116*a1347418SPatrick Williamsthe OS or the hypervisor boot, while the [BootProgress][4] property is used 117388b58f9SPatrick Williamsmainly for indicating system firmware boot progress. The enumerations used in 118388b58f9SPatrick Williamsboth the cases are influenced by standard interfaces like IPMI 2.0 (Section 119388b58f9SPatrick Williams42.2, Sensor Type Codes and Data, Table 42, Base OS boot status) and PLDM state 120388b58f9SPatrick Williamsspec (DSP0249, Section 6.3, State Sets Tables, Table 7 – Boot-Related State 121388b58f9SPatrick WilliamsSets, Set ID - 196 Boot Progress). 122b1b4d261SWilliam A. Kennington III 123*a1347418SPatrick Williams[1]: 124*a1347418SPatrick Williams https://github.com/openbmc/docs/blob/master/architecture/openbmc-systemd.md#error-handling-of-systemd 125*a1347418SPatrick Williams[2]: 126*a1347418SPatrick Williams https://github.com/openbmc/phosphor-dbus-interfaces/tree/master/yaml/xyz/openbmc_project/State/ 127*a1347418SPatrick Williams[3]: 128*a1347418SPatrick Williams https://github.com/openbmc/phosphor-dbus-interfaces/tree/master/yaml/xyz/openbmc_project/State/OperatingSystem/Status.interface.yaml 129*a1347418SPatrick Williams[4]: 130*a1347418SPatrick Williams https://github.com/openbmc/phosphor-dbus-interfaces/tree/master/yaml/xyz/openbmc_project/State/Boot/Progress.interface.yaml 131