commit | 3a2d042432168ad1b555e4fc9f13c2ae0d35e0c7 | [log] [tgz] |
---|---|---|
author | Chris Cain <cjcain@us.ibm.com> | Fri May 28 16:57:10 2021 -0500 |
committer | Chris Cain <cjcain@us.ibm.com> | Thu Jul 01 13:58:21 2021 -0500 |
tree | f84c071fc6cb99dcdd10bdfaebb75298879fff1c | |
parent | 1981771bbd8aac1d689a9c5e258a99e655a76b29 [diff] |
Systems: Add PowerMode support The computer system power mode defines the behavior of a system based on the performance and power saving requirements. For example, a system could be set to MaximumPerformance to run as fast as possible without regard to power consumption. A system could also be configured to run in PowerSaving mode which would be running at slower speeds to try to save power. More information can be found at https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/38786 This commit will allow GET / PATCH operations to the PowerMode property PowerMode was added in Redfish Release 2021.1: https://www.dmtf.org/content/redfish-release-20211-now-available Tested: I manually tested retrieving and setting the PowerMode property on a Rainier system (with good and bad values): # curl -k https://$bmc/redfish/v1/Systems/system { "@odata.id": "/redfish/v1/Systems/system", "@odata.type": "#ComputerSystem.v1_15_0.ComputerSystem ... "PartNumber": "", "PowerMode": "MaximumPerformance", "PowerMode@Redfish.AllowableValues": [ "Static", "MaximumPerformance", "PowerSaving" ], "PowerRestorePolicy": "AlwaysOff", ... # curl -k https://$bmc/xyz/openbmc_project/control/host0/power_mode { "data": { "PowerMode": "xyz.openbmc_project.Control.Power.Mode.PowerMode.MaximumPerformance" }, "message": "200 OK", "status": "ok" } # curl -k -X PATCH -d '{ "PowerMode":"Static"}' https://$bmc/redfish/v1/Systems/system curl -k https://$bmc/xyz/openbmc_project/control/host0/power_mode { "data": { "PowerMode": "xyz.openbmc_project.Control.Power.Mode.PowerMode.Static" }, "message": "200 OK", "status": "ok" } Ran Validator on hardware and all tests passed: Elapsed time: 0:05:07 Counter({'skipOptional': 7128, 'pass': 6020, 'metadataNamespaces': 2217, 'passGet': 315, 'warnDeprecated': 212, 'serviceNamespaces': 79, 'warningPresent': 47, 'warnTrailingSlashLink': 24, 'invalidPropertyValue': 18, 'passAction': 14, 'optionalAction': 11, 'repeat': 3, 'unverifiedComplexAdditional': 1}) Validation has succeeded. Signed-off-by: Chris Cain <cjcain@us.ibm.com> Change-Id: I5523a0ebe4a2a77ea4709a14863bff7b55f0303d
This component attempts to be a "do everything" embedded webserver for openbmc.
At this time, the webserver implements a few interfaces:
BMCWeb is configured by setting -D
flags that correspond to options in bmcweb/meson_options.txt
and then compiling. For example, meson <builddir> -Dkvm=disabled ...
followed by ninja
in build directory. The option names become C++ preprocessor symbols that control which code is compiled into the program.
meson builddir ninja -C builddir
meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled ninja -C buildir
If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in bmcweb/subprojects
.
meson builddir -Dwrap_mode=nofallback ninja -C builddir
meson builddir -Dbuildtype=debug ninja -C builddir
meson builddir -Db_coverage=true -Dtests=enabled ninja coverage -C builddir test
When BMCWeb starts running, it reads persistent configuration data (such as UUID and session data) from a local file. If this is not usable, it generates a new configuration.
When BMCWeb SSL support is enabled and a usable certificate is not found, it will generate a self-sign a certificate before launching the server. The keys are generated by the secp384r1
algorithm. The certificate
C=US, O=OpenBMC, CN=testhost
,SHA-256
algorithm.