Closed gkeishin closed 5 years ago
@geissonator if there are way how to detect without looking at the journald that would help here..
Redfish would probably recommend TaskService for this kind of long running operation.
Yeah there's a big discussion ongoing within the DMTF on code update and task services. I think it's best to let that settle and come back to Redfish UpdateService in OpenBMC release 2.8. We have the basics in place now for 2.7 so if people need it, it's there. Lets wait for the DMTF to sort things out a bit more before we do much more work.
With that said, similar things can be done that were recommended via the REST service update path. Like pre-hashing the image to figure out the identifier and then polling for that to show up in the firmware inventory.
I'm thinking I should use this issue to properly fill in the "Status" field. Only set it to OK/Enabled once the update has completed?
My proposal here is the following:
Change doGet on /redfish/v1/UpdateService/FirmwareInventory/ to return all software inventory items (not just what we do now, xyz.openbmc_project.Software.Activation.Activations.Active)
We then change the code in the get of "/redfish/v1/UpdateService/FirmwareInventory/swID/" to put the correct "Status" in the returned object. It's currently hard coded to this:
res.jsonValue["Status"]["Health"] = "OK";
res.jsonValue["Status"]["HealthRollup"] = "OK";
res.jsonValue["Status"]["State"] = "Enabled";
The possible software states are defined in https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Software/Activation.interface.yaml. Here's a proposed mapping to the Redfish Status for them:
NotReady -> UnavailableOffline Invalid -> Disabled Ready -> StandbyOffline Activating -> Updating Active -> Enabled Failed -> Disabled
Redfish Status object is defined in http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/Status
If this looks ok to people I can get a design doc update loaded into gerrit with this. This would give user of the Redfish UpdateService more insight into what firmware is available and it's different states.
Design doc update is in https://gerrit.openbmc-project.xyz/c/openbmc/docs/+/21986
Upload image
From the journald, I can see the image is uploaded and untared
So I dont see the image I'm trying to update, so I checked the /tmp/images/8d2586e3 and found the magic id
8d2586e3
So now I can see the image properties but I dont know for sure if the update is completed or not. I know for sure the update hasnt completed since I see the install is going on when I query the GET request on the image id of the code update in progress..
Couple of things: