From 3602e232fda4a6ddac4dcf6d3a024bd5ff6e7835 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Mon, 13 May 2019 11:11:44 -0700 Subject: Redfish: Fix managers UUID mixup In redfish, there are 3 UUIDs. 1. Service root. This is unique to Redfish, and not needed outside the service. It is generated on first startup, and persisted to nonvolatile in the bmcweb_persistent_data.json file. This is the one that is present in the ServiceRoot schema, as well as in the Systems schema under the ServiceEntryPointUUID. 2. Managers. This UUID needs to match the UUID avaialble in IPMI, using the Get Device GUID command. This is generated via the systemd sd_id128_get_machine_app_specific call, with a matching application ID in ipmi. 3. System. This UUID is generated from teh host system. In the case of Power, it comes from settingsd. In the case of x86, it comes from MDRv2. This patchset corrects a few properties to pull from the correct place, after some regressions in the last few weeks that weren't caught right away. Vernon has an oncoming patch to IPMI to correct the IPMI side of this. Signed-off-by: Ed Tanous Change-Id: I98f3a06ba552c84142aaa749cfd199541a0ae1fd --- redfish-core/lib/managers.hpp | 4 ++-- redfish-core/lib/service_root.hpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp index 2df6034..5f5ef6e 100644 --- a/redfish-core/lib/managers.hpp +++ b/redfish-core/lib/managers.hpp @@ -944,8 +944,8 @@ class Manager : public Node res.jsonValue["PowerState"] = "On"; res.jsonValue["Status"] = {{"State", "Enabled"}, {"Health", "OK"}}; res.jsonValue["ManagerType"] = "BMC"; - res.jsonValue["UUID"] = uuid; - res.jsonValue["ServiceEntryPointUUID"] = systemd_utils::getUuid(); + res.jsonValue["UUID"] = systemd_utils::getUuid(); + res.jsonValue["ServiceEntryPointUUID"] = uuid; res.jsonValue["Model"] = "OpenBmc"; // TODO(ed), get model res.jsonValue["LogServices"] = { diff --git a/redfish-core/lib/service_root.hpp b/redfish-core/lib/service_root.hpp index a525ca6..ad2b2f2 100644 --- a/redfish-core/lib/service_root.hpp +++ b/redfish-core/lib/service_root.hpp @@ -27,6 +27,8 @@ class ServiceRoot : public Node public: ServiceRoot(CrowApp& app) : Node(app, "/redfish/v1/") { + uuid = app.template getMiddleware() + .systemUuid; entityPrivileges = { {boost::beast::http::verb::get, {}}, {boost::beast::http::verb::head, {}}, @@ -64,9 +66,11 @@ class ServiceRoot : public Node res.jsonValue["UpdateService"] = { {"@odata.id", "/redfish/v1/UpdateService"}}; - res.jsonValue["UUID"] = systemd_utils::getUuid(); + res.jsonValue["UUID"] = uuid; res.end(); } + + std::string uuid; }; } // namespace redfish -- cgit v1.2.3