summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2019-05-13 11:11:44 -0700
committerEd Tanous <ed.tanous@intel.com>2019-05-13 11:18:15 -0700
commit3602e232fda4a6ddac4dcf6d3a024bd5ff6e7835 (patch)
tree7d08523cfb0a3b9811a8a425dc177741e3b02709
parentcd225da87857c153e81f3abca6dfcc61c08272ea (diff)
downloadbmcweb-3602e232fda4a6ddac4dcf6d3a024bd5ff6e7835.tar.gz
bmcweb-3602e232fda4a6ddac4dcf6d3a024bd5ff6e7835.zip
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 <ed.tanous@intel.com> Change-Id: I98f3a06ba552c84142aaa749cfd199541a0ae1fd
-rw-r--r--redfish-core/lib/managers.hpp4
-rw-r--r--redfish-core/lib/service_root.hpp6
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<crow::persistent_data::Middleware>()
+ .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
OpenPOWER on IntegriCloud