sag
Minnow
Posts: 18
|
Post by sag on Jun 1, 2022 16:09:56 GMT
I've just read the "Redfish Firmware Update White Paper".
In my use case, the update requires user interaction (for stuff like activating the new image and possibly resetting the device). In such cases, the whitepaper recommends transitioning from a Task to a Job.
However, the transition is not explained in the whitepaper or the specification. Here's how I understand the procedure (for PUSH update model), with my questions inside in bold.
1. The user sets the HttpPushUriXY parameters as needed.
2. The user pushes the image to the MultipartHttpPushUri URL and receives 202 response with a Task Monitor link in Location header.
3. The server creates a Job for the update. The Task gets a new Message with MessageId OperationTransitionedToJob and a link to the Job in ExtendedInfo. Q1 What is the TaskState from now on? Q2 What is the response for GETting the Task Monitor?
4. The Job proceeds, occasionally changing JobState to UserIntervention. Finally it reaches Completed JobState. Q3 Does the original Task change? Q4 Does the TaskMonitor response change?
By the way, hiding the URI to the Job in MessageArgs for ExtendedInfo for the OperationTransitionedToJob Message is quite obscure. I was expecting the Job URI in a Location header at some step.
|
|
|
Post by mraineri on Jun 2, 2022 0:08:14 GMT
The "HttpPushUriXYZ" properties are not needed; these work in conjunction when the client performs a POST to the URI shown in "HttpPushUri". When working with MultipartHttpPushUri, the parameters are all described in the request body when performing a POST to the URI shown in "MultipartHttpPushUri". So, skip step 1 entirely.
Q1: The Task at this point is done since it has transitioned. So, TaskState would be "Completed". Q2: The response would be the operation result. Since the operation is transitioning to being managed via a Job, this would be an error response body as shown in the "Update operation response management" section of the white paper you've just read. Effectively this means the POST operation to the MultipartHttpPushUri is done.
Q3: No, the task is done at this point and is no longer needed. Q4: Same as above; the task is done so the response for a GET on the task monitor will either be the error response object described in "Update operation response management", or could be a 404 if the service cleaned up the task monitor.
Essentially in this flow, the task produced reflects the POST operation to the MultipartHttpPushUri. Once the transition to a job is performed, the original operation is complete, but further work is needed to monitor the flow of the update. While it would have been better to keep everything in the confines of the original task, there is a backwards compatibility issue that can be encountered: tasks do not pause and wait for user intervention, so existing clients that monitor tasks would be stuck in a forever loop. We also chose the message path to redirect clients since there could be other messages with other URIs in parallel that a client might need to follow for further operations; simply using the Location header doesn't give the client context of the URI itself (such as the URI for an action that needs to be performed or another object that needs to be polled).
|
|
sag
Minnow
Posts: 18
|
Post by sag on Jun 2, 2022 7:39:59 GMT
Hi Mike, thanks for your reply.
I'm confused about your first statement, because I haven't seen even a hint that the POST request to MultipartHttpPushUri can contain anything but the update image. I though that the client needs to PATCH HttpPushUriOptionsBusy to true in order to be able to PATCH properties like ForceUpdate or HttpPushUriApplyTime.
Regarding your reply to my Q1 and Q2, the example in the whitepaper is self-contradictory, because it shows a success code 200 with an error response. The same thing about your response: how can the TaskState be Completed, instead of Exception if it ended with an error?
|
|
|
Post by mraineri on Jun 3, 2022 14:40:47 GMT
The Redfish Specification itself contains the description of what is allowed inside of the POST request for the multipart update. The "Multipart HTTP push updates" clause of the Redfish Specification contains the details for this. Multipart requests contain multiple forms, and with the way Redfish defines its usage, there's a JSON portion that contains control parameters, an octet stream portion that contains the image, and an OEM portion for anything vendor-specific. The "Multipart HTTP push update" section of the white paper you've been reading contains an example of this as well.
For your follow-up on Q1 and Q2, yes, it's very unfortunate but this is correct. The reason for this is because of OData usage of responses to actions where a return body is not defined in schema; their pattern is to use the OData-defined error response (which Redfish leverages). In hindsight, we should have explicitly defined return bodies for all actions, but doing so at this point would break backwards compatibility. Essentially what we're left with is "Error: Success!" in many cases.
|
|
sag
Minnow
Posts: 18
|
Post by sag on Jun 7, 2022 13:19:55 GMT
Mike, thanks for both explanations - you've cleared the picture for me. I didn't initially understand the JSON portion of Multipart push update and I was focused on "ApplyTime" from HttpPushUriOptions, which actually cannot be sent via the JSON section of Multipart request - the "UpdateParameters" structure only accepts a subset of the parameters for Multipart push update: parameter | can be sent in UpdateParameters in Multipart request | can be modified via PATCHing HttpPushUriOptions | comment | Targets | yes | - |
| HttpPushUriApplyTime
| - | yes | includes ApplyTime, MaintenanceWindowStartTime, MaintenanceWindowDurationInSeconds | ForceUpdate | yes | yes | not clear which value takes precedence |
|
|
|
Post by mraineri on Jun 7, 2022 23:37:02 GMT
Like with actions, you can use the "@redfish.OperationApplyTime" term in the JSON form for the multipart request to specify an apply time. For example:
{ "@Redfish.OperationApplyTime": "OnReset" } The reason dedicated properties were created for the HttpPushUri method was because there is no standard definition of the request body for the POST operation; the entire body of this is vendor-defined. The JSON form of the multipart request is standardized, which allows us to have well-known parameters (defined in UpdateParameters object in the UpdateService schema), and standard Redfish payload annotations (like @redfish.OperationApplyTime).
|
|