11034e026SEd Tanous# Entity Manager 21034e026SEd Tanous 31034e026SEd TanousEntity manager is a design for managing physical system components, and mapping 41034e026SEd Tanousthem to software resources within the BMC. Said resources are designed to allow 51034e026SEd Tanousthe flexible adjustment of the system at runtime, as well as the reduction in 61034e026SEd Tanousthe number of independent system configurations one needs to create. 71034e026SEd Tanous 81034e026SEd Tanous## Definitions 91034e026SEd Tanous 101034e026SEd Tanous### Entity 11fa8ee87eSPatrick Williams 121034e026SEd TanousA server component that is physically separate, detectable through some means, 13fa8ee87eSPatrick Williamsand can be added or removed from a given OpenBMC system. Said component can, and 14fa8ee87eSPatrick Williamslikely does contain multiple sub-components, but the component itself as a whole 15fa8ee87eSPatrick Williamsis referred to as an entity. 161034e026SEd Tanous 171034e026SEd TanousNote, this term is needed because most other terms that could've been used 181034e026SEd Tanous(Component, Field Replaceable Unit, or Assembly) are already overloaded in the 191034e026SEd Tanousindustry, and have a distinct definition already, which is a subset of what an 201034e026SEd Tanousentity encompasses. 211034e026SEd Tanous 221034e026SEd Tanous### Exposes 23fa8ee87eSPatrick Williams 241034e026SEd TanousA particular feature of an Entity. An Entity generally will have multiple 251034e026SEd TanousExposes records for the various features that component supports. Some examples 261034e026SEd Tanousof features include, LM75 sensors, PID control parameters, or CPU information. 271034e026SEd Tanous 281034e026SEd Tanous### Probe 29fa8ee87eSPatrick Williams 301034e026SEd TanousA set of rules for detecting a given entity. Said rules generally take the form 311034e026SEd Tanousof a D-Bus interface definition. 321034e026SEd Tanous 331034e026SEd Tanous## Goals 34fa8ee87eSPatrick Williams 351034e026SEd TanousEntity manager has the following goals (unless you can think of better ones): 361034e026SEd Tanous 371034e026SEd Tanous1. Minimize the time and debugging required to "port" OpenBMC to new systems 381034e026SEd Tanous2. Reduce the amount of code that is different between platforms 391034e026SEd Tanous3. Create system level maintainability in the long term, across hundreds of 401034e026SEd Tanous platforms and components, such that components interoperate as much as 411034e026SEd Tanous physically possible. 421034e026SEd Tanous 431034e026SEd Tanous## Implementation 44fa8ee87eSPatrick Williams 451034e026SEd TanousA full BMC setup using Entity Manager consists of a few parts: 461034e026SEd Tanous 471034e026SEd Tanous1. **A detection daemon** This is something that can be used to detect 481034e026SEd Tanous components at runtime. The most common of these, fru-device, is included in 491034e026SEd Tanous the Entity-Manager repo, and scans all available I2C buses for IPMI FRU 501034e026SEd Tanous EEPROM devices. Other examples of detection daemons include: 51fa8ee87eSPatrick Williams **[peci-pcie](https://github.com/openbmc/peci-pcie):** A daemon that utilizes 52fa8ee87eSPatrick Williams the CPU bus to read in a list of PCIe devices from the processor. 53fa8ee87eSPatrick Williams **[smbios-mdr](https://github.com/openbmc/smbios-mdr):** A daemon that 54fa8ee87eSPatrick Williams utilizes the x86 SMBIOS table specification to detect the available systems 55fa8ee87eSPatrick Williams dependencies from BIOS. 561034e026SEd Tanous 571034e026SEd Tanous In many cases, the existing detection daemons are sufficient for a single 581034e026SEd Tanous system, but in cases where there is a superseding inventory control system in 591034e026SEd Tanous place (such as in a large datacenter) they can be replaced with application 601034e026SEd Tanous specific daemons that speak the protocol information of their controller, and 611034e026SEd Tanous expose the inventory information, such that failing devices can be detected 621034e026SEd Tanous more readily, and system configurations can be "verified" rather than 631034e026SEd Tanous detected. 641034e026SEd Tanous 651034e026SEd Tanous2. **An entity manager configuration file** Entity manager configuration files 661034e026SEd Tanous are located in the ./configurations directory in the entity manager 67fa8ee87eSPatrick Williams repository, and include one file per device supported. Entities are detected 68fa8ee87eSPatrick Williams based on the "Probe" key in the json file. The intention is that this folder 69fa8ee87eSPatrick Williams contains all hardware configurations that OpenBMC supports, to allows an easy 70fa8ee87eSPatrick Williams answer to "Is X device supported". An EM configuration contains a number of 71fa8ee87eSPatrick Williams Exposes records that specify the specific features that this Entity supports. 72fa8ee87eSPatrick Williams Once a component is detected, entity manager will publish these Exposes 73fa8ee87eSPatrick Williams records to D-Bus. 741034e026SEd Tanous 751034e026SEd Tanous3. **A reactor** The reactors are things that take the entity manager 761034e026SEd Tanous configurations, and use them to execute and enable the features that they 771034e026SEd Tanous describe. One example of this is dbus-sensors, which contains a suite of 781034e026SEd Tanous applications that input the Exposes records for sensor devices, then connect 791034e026SEd Tanous to the filesystem to create the sensors and scan loops to scan sensors for 801034e026SEd Tanous those devices. Other examples of reactors could include: CPU management 811034e026SEd Tanous daemons and Hot swap backplane management daemons, or drive daemons. 821034e026SEd Tanous 831034e026SEd Tanous**note:** In some cases, a given daemon could be both a detection daemon and a 841034e026SEd Tanousreactor when architectures are multi-tiered. An example of this might include a 851034e026SEd Tanoushot swap backplane daemon, which both reacts to the hot swap being detected, and 861034e026SEd Tanousalso creates detection records of what drives are present. 871034e026SEd Tanous 883f3fa4cdSMatt Spinler### Associations 893f3fa4cdSMatt Spinler 903f3fa4cdSMatt SpinlerEntity Manager will automatically create associations between its entities in 913f3fa4cdSMatt Spinlercertain cases. For details see [here](docs/associations.md). 923f3fa4cdSMatt Spinler 931034e026SEd Tanous## Requirements 941034e026SEd Tanous 951034e026SEd Tanous1. Entity manager shall support the dynamic discovery of hardware at runtime, 96fa8ee87eSPatrick Williams using inventory interfaces. The types of devices include, but are not limited 97fa8ee87eSPatrick Williams to hard drives, hot swap backplanes, baseboards, power supplies, CPUs, and 98fa8ee87eSPatrick Williams PCIe Add-in-cards. 991034e026SEd Tanous 1001034e026SEd Tanous2. Entity manager shall support the ability to add or remove support for 1011034e026SEd Tanous particular devices in a given binary image. By default, entity manager will 1021034e026SEd Tanous support all available and known working devices for all platforms. 1031034e026SEd Tanous 104fa8ee87eSPatrick Williams3. Entity manager shall provide data to D-Bus about a particular device such 105fa8ee87eSPatrick Williams that other daemons can create instances of the features being exposed. 1061034e026SEd Tanous 1071034e026SEd Tanous4. Entity manager shall support multiple detection runs, and shall do the 1081034e026SEd Tanous minimal number of changes necessary when new components are detected or no 1091034e026SEd Tanous longer detected. Some examples of re-detection events might include host 1101034e026SEd Tanous power on, drive plug/unplug, PSU plug/unplug. 1111034e026SEd Tanous 1121034e026SEd Tanous5. Entity manager shall have exactly one configuration file per supported device 1131034e026SEd Tanous model. In some cases this will cause duplicated information between files, 1141034e026SEd Tanous but the ability to list and see all supported device models in a single 1151034e026SEd Tanous place, as well as maintenance when devices do differ in the future is 1161034e026SEd Tanous determined to be more important than duplication of configuration files. 1171034e026SEd Tanous 1181034e026SEd Tanous### Explicitly out of scope 119fa8ee87eSPatrick Williams 1201034e026SEd Tanous1. Entity manager shall not directly participate in the detection of devices, 1211034e026SEd Tanous and instead will rely on other D-Bus applications to publish interfaces that 1221034e026SEd Tanous can be detected. 1231034e026SEd Tanous2. Entity manager shall not directly participate in management of any specific 1241034e026SEd Tanous device. This is requirement is intended to intentionally limit the size and 1251034e026SEd Tanous feature set of entity manager, to ensure it remains small, and effective to 1261034e026SEd Tanous all users. 1271034e026SEd Tanous 1281034e026SEd Tanous### Entity Manager Compatible Software 129fa8ee87eSPatrick Williams 1301034e026SEd Tanous**bmcweb** A webserver implementation that uses the inventory information from 131fa8ee87eSPatrick Williamsentity-manager to produce a Redfish compliant REST API. **intel-ipmi-oem** An 132fa8ee87eSPatrick Williamsimplementation of the IPMI SDR, FRU, and Storage commands that utilize Entity 133fa8ee87eSPatrick WilliamsManager as the source of information. 1346bf41588SZhikui Ren 1356bf41588SZhikui Ren## Additional Documentation 136fa8ee87eSPatrick Williams 1373ce9143fSBrad Bishop1. **[Entity Manager DBus API](https://github.com/openbmc/entity-manager/blob/master/docs/entity_manager_dbus_api.md)** 1386bf41588SZhikui Ren2. **[My First Sensor Example](https://github.com/openbmc/entity-manager/blob/master/docs/my_first_sensors.md)** 1396bf41588SZhikui Ren3. **[Configuration File Schema](https://github.com/openbmc/entity-manager/tree/master/schemas)** 140*b25b1ebcSMatt Spinler4. **[EEPROM address size detection modes](https://github.com/openbmc/entity-manager/tree/master/docs/address_size_detection_modes.md)** 141