| commit | 159830a665e0f98b9499c5bf7c536bbc8c3047e7 | [log] [tgz] |
|---|---|---|
| author | Munawar Hussain <munawarhussain@google.com> | Mon Sep 02 11:31:23 2024 +0000 |
| committer | Munawar Hussain <munawarhussain@google.com> | Tue Oct 29 23:46:44 2024 +0000 |
| tree | 9e9bb2692e898aa1120d3439ecd8bd1a61294f98 | |
| parent | ef3b2086b2a1cddd9f46980ad7155594372821a4 [diff] |
Implement BootTime LogService for system and bmc
Under BootTimeMonitor service we are storing boot time log entries-
* Checkpoints: at which time, machine at a specific stage
* Durations: how long does it take for a certain stage?
* Statistics: Whether the component is rebooting or not.
Since all of the data are like log or event, we are exporting all these
information as part of a logservice "BootTime".
* OEMDiagnosticDataType contains the type of the log
* DiagnosticData contains the base64 encoded json of the data
The feature is only for single host right now since the service captures only one host.
Design Doc: go/deoxys-redfish-schema
Tested:
```
root@bmc:~# curl localhost/redfish/v1/Systems/system/LogServices/
{
"@odata.id": "/redfish/v1/Systems/system/LogServices",
"@odata.type": "#LogServiceCollection.LogServiceCollection",
"Description": "Collection of LogServices for this Computer System",
"Members": [
...
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/BootTime"
},
...
],
"Members@odata.count": 6,
"Name": "System Log Services Collection"
}
root@bmc:~# curl localhost/redfish/v1/Systems/system/LogServices/BootTime
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/BootTime",
"@odata.type": "#LogService.v1_1_0.LogService",
"DateTime": "2024-09-08T16:40:34+00:00",
"DateTimeLocalOffset": "+00:00",
"Description": "Boot Time Log Service",
"Entries": {
"@odata.id": "/redfish/v1/Systems/system/LogServices/BootTime/Entries"
},
"Id": "BootTime",
"LogEntryType": "Multiple",
"Name": "Boot Time Log Service",
"OverWritePolicy": "WrapsWhenFull"
}
root@bmc:~# curl localhost/redfish/v1/Systems/system/LogServices/BootTime/Entries
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/BootTime/Entries",
"@odata.type": "#LogEntryCollection.LogEntryCollection",
"Description": "Collection of Boot time Log Entries with checkpoints and duration",
"Members": [
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/BootTime/Entries/Checkpoint-0",
"@odata.type": "#LogEntry.v1_15_0.LogEntry",
"DiagnosticData": "eyJNb25vVGltZU1zIjo4MTA3MCwiTmFtZSI6Ikhvc3RTdGF0ZTpPZmYiLCJXYWxsVGltZU1zIjoxNzAyNjU0NjQ2Nzk5fQ==",
"EntryType": "Oem",
"Id": "Checkpoint-0",
"Message": "{\"MonoTimeMs\":81070,\"Name\":\"HostState:Off\",\"WallTimeMs\":1702654646799}",
"Name": "Boot Time Log Entry",
"OEMDiagnosticDataType": "Checkpoint"
},
...
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/BootTime/Entries/Duration-2",
"@odata.type": "#LogEntry.v1_15_0.LogEntry",
"DiagnosticData": "eyJEdXJhdGlvbk1zIjozNjAwMCwiTmFtZSI6Ik5lcmZESENQIn0=",
"EntryType": "Oem",
"Id": "Duration-2",
"Message": "{\"DurationMs\":36000,\"Name\":\"NerfDHCP\"}",
"Name": "Boot Time Log Entry",
"OEMDiagnosticDataType": "Duration"
},
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/BootTime/Entries/Statistic-0",
"@odata.type": "#LogEntry.v1_15_0.LogEntry",
"DiagnosticData": "eyJJc1JlYm9vdGluZyI6dHJ1ZX0=",
"EntryType": "Oem",
"Id": "Statistic-0",
"Message": "{\"IsRebooting\":true}",
"Name": "Boot Time Log Entry",
"OEMDiagnosticDataType": "Statistic"
}
],
"Members@odata.count": 9,
"Name": "Boot Time Log Entries"
}root@bmc:~# curl localhost/redfish/v1/Systems/system/LogServices/BootTime/Entries/Statistic-0
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/BootTime/Entries/Statistic-0",
"@odata.type": "#LogEntry.v1_15_0.LogEntry",
"DiagnosticData": "eyJJc1JlYm9vdGluZyI6dHJ1ZX0=",
"EntryType": "Oem",
"Id": "Statistic-0",
"Message": "{\"IsRebooting\":true}",
"Name": "Boot Time Log Entry",
"OEMDiagnosticDataType": "Statistic"
}root@bmc:~# curl localhost/redfish/v1/Systems/system/LogServices/BootTime/Entries/Statistic-2
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type LogEntry named 'Statistic-2' was not found.",
"MessageArgs": [
"LogEntry",
"Statistic-2"
],
"MessageId": "Base.1.13.0.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier and resubmit the request."
}
],
"code": "Base.1.13.0.ResourceNotFound",
"message": "The requested resource of type LogEntry named 'Statistic-2' was not found."
}
}root@bmc:~# curl localhost/redfish/v1/Systems/system/LogServices/BootTime/Entries/Statistic--1
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type LogEntry named 'Statistic--1' was not found.",
"MessageArgs": [
"LogEntry",
"Statistic--1"
],
"MessageId": "Base.1.13.0.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier and resubmit the request."
}
],
"code": "Base.1.13.0.ResourceNotFound",
"message": "The requested resource of type LogEntry named 'Statistic--1' was not found."
}
}root@bmc:~# curl localhost/redfish/v1/Systems/system/LogServices/BootTime/Entries/Statistic-
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type LogEntry named 'Statistic-' was not found.",
"MessageArgs": [
"LogEntry",
"Statistic-"
],
"MessageId": "Base.1.13.0.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier and resubmit the request."
}
],
"code": "Base.1.13.0.ResourceNotFound",
"message": "The requested resource of type LogEntry named 'Statistic-' was not found."
}
}root@bmc:~# curl localhost/redfish/v1/Systems/system/LogServices/BootTime/Entries/Statisti
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The requested resource of type LogEntry named 'Statisti' was not found.",
"MessageArgs": [
"LogEntry",
"Statisti"
],
"MessageId": "Base.1.13.0.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier and resubmit the request."
}
],
"code": "Base.1.13.0.ResourceNotFound",
"message": "The requested resource of type LogEntry named 'Statisti' was not found."
}
}root@bmc:~# curl localhost/redfish/v1/Systems/system/LogServices/BootTime/Entries/Checkpoint-0
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/BootTime/Entries/Checkpoint-0",
"@odata.type": "#LogEntry.v1_15_0.LogEntry",
"DiagnosticData": "eyJNb25vVGltZU1zIjo4MTA3MCwiTmFtZSI6Ikhvc3RTdGF0ZTpPZmYiLCJXYWxsVGltZU1zIjoxNzAyNjU0NjQ2Nzk5fQ==",
"EntryType": "Oem",
"Id": "Checkpoint-0",
"Message": "{\"MonoTimeMs\":81070,\"Name\":\"HostState:Off\",\"WallTimeMs\":1702654646799}",
"Name": "Boot Time Log Entry",
"OEMDiagnosticDataType": "Checkpoint"
}
root@bmc:~# curl localhost/redfish/v1/Systems/system/LogServices/BootTime/Entries/Duration-1
{
"@odata.id": "/redfish/v1/Systems/system/LogServices/BootTime/Entries/Duration-1",
"@odata.type": "#LogEntry.v1_15_0.LogEntry",
"DiagnosticData": "eyJEdXJhdGlvbk1zIjozNjAwMCwiTmFtZSI6Ik5lcmZVc2VyIn0=",
"EntryType": "Oem",
"Id": "Duration-1",
"Message": "{\"DurationMs\":36000,\"Name\":\"NerfUser\"}",
"Name": "Boot Time Log Entry",
"OEMDiagnosticDataType": "Duration"
}
root@bmc:~# curl localhost/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries",
"@odata.type": "#LogEntryCollection.LogEntryCollection",
"Description": "Collection of Boot time Log Entries with checkpoints and duration",
"Members": [
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/Checkpoint-0",
"@odata.type": "#LogEntry.v1_15_0.LogEntry",
"DiagnosticData": "eyJNb25vVGltZU1zIjoxODczNDAsIk5hbWUiOiJIb3N0UmVsZWFzZWQiLCJXYWxsVGltZU1zIjoxNzAyNjU0NzUzMDY3fQ==",
"EntryType": "Oem",
"Id": "Checkpoint-0",
"Message": "{\"MonoTimeMs\":187340,\"Name\":\"HostReleased\",\"WallTimeMs\":1702654753067}",
"Name": "Boot Time Log Entry",
"OEMDiagnosticDataType": "Checkpoint"
},
...
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/Duration-5",
"@odata.type": "#LogEntry.v1_15_0.LogEntry",
"DiagnosticData": "eyJEdXJhdGlvbk1zIjozMjExOTYsIk5hbWUiOiJVc2Vyc3BhY2UifQ==",
"EntryType": "Oem",
"Id": "Duration-5",
"Message": "{\"DurationMs\":321196,\"Name\":\"Userspace\"}",
"Name": "Boot Time Log Entry",
"OEMDiagnosticDataType": "Duration"
},
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/Statistic-0",
"@odata.type": "#LogEntry.v1_15_0.LogEntry",
"DiagnosticData": "eyJJc1JlYm9vdGluZyI6ZmFsc2V9",
"EntryType": "Oem",
"Id": "Statistic-0",
"Message": "{\"IsRebooting\":false}",
"Name": "Boot Time Log Entry",
"OEMDiagnosticDataType": "Statistic"
}
],
"Members@odata.count": 9,
"Name": "Boot Time Log Entries"
}root@bmc:~# curl localhost/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/Duration-5
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/Duration-5",
"@odata.type": "#LogEntry.v1_15_0.LogEntry",
"DiagnosticData": "eyJEdXJhdGlvbk1zIjozMjExOTYsIk5hbWUiOiJVc2Vyc3BhY2UifQ==",
"EntryType": "Oem",
"Id": "Duration-5",
"Message": "{\"DurationMs\":321196,\"Name\":\"Userspace\"}",
"Name": "Boot Time Log Entry",
"OEMDiagnosticDataType": "Duration"
}
root@bmc:~# curl localhost/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/Checkpoint-1
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/Checkpoint-1",
"@odata.type": "#LogEntry.v1_15_0.LogEntry",
"DiagnosticData": "eyJNb25vVGltZU1zIjozNTg0MTAsIk5hbWUiOiJVc2Vyc3BhY2VFbmQiLCJXYWxsVGltZU1zIjoxNzI1Nzk1NDE2NDEyfQ==",
"EntryType": "Oem",
"Id": "Checkpoint-1",
"Message": "{\"MonoTimeMs\":358410,\"Name\":\"UserspaceEnd\",\"WallTimeMs\":1725795416412}",
"Name": "Boot Time Log Entry",
"OEMDiagnosticDataType": "Checkpoint"
}
root@bmc:~# curl localhost/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/Statistic-0
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/BootTime/Entries/Statistic-0",
"@odata.type": "#LogEntry.v1_15_0.LogEntry",
"DiagnosticData": "eyJJc1JlYm9vdGluZyI6ZmFsc2V9",
"EntryType": "Oem",
"Id": "Statistic-0",
"Message": "{\"IsRebooting\":false}",
"Name": "Boot Time Log Entry",
"OEMDiagnosticDataType": "Statistic"
}
```
Google-Bug-Id: 296791271
Change-Id: Ib225f251c3f6c406c6998ae1eb815ddb7135987e
Signed-off-by: Munawar Hussain <munawarhussain@google.com>
This project is Google's version of BMCWeb.
See Readme Google for Google added features. The following is the original README of OpenBMC/BMCWeb.
==============================================================================
This component attempts to be a “do everything” embedded webserver for OpenBMC.
The webserver implements a few distinct interfaces:
bmcweb at a protocol level supports http and https. TLS is supported through OpenSSL.
Bmcweb supports multiple authentication protocols:
Each of these types of authentication is able to be enabled or disabled both via runtime policy changes (through the relevant Redfish APIs) or via configure time options. All authentication mechanisms supporting username/password are routed to libpam, to allow for customization in authentication implementations.
All authorization in bmcweb is determined at routing time, and per route, and conform to the Redfish PrivilegeRegistry.
*Note: Non-Redfish functions are mapped to the closest equivalent Redfish privilege level.
bmcweb is configured per the meson build files. Available options are documented in meson_options.txt
meson builddir ninja -C builddir
If any of the dependencies are not found on the host system during configuration, meson will automatically download them via its wrap dependencies mentioned in bmcweb/subprojects.
bmcweb relies on some on-system data for storage of persistent data that is internal to the process. Details on the exact data stored and when it is read/written can seen from the persistent_data namespace.
When SSL support is enabled and a usable certificate is not found, bmcweb will generate a self-signed a certificate before launching the server. Please see the bmcweb source code for details on the parameters this certificate is built with.
bmcweb is capable of aggregating resources from satellite BMCs. Refer to AGGREGATION.md for more information on how to enable and use this feature.