How to update system firmware using the XCC Redfish REST API for ThinkSystem servers
How to update system firmware using the XCC Redfish REST API for ThinkSystem servers
How to update system firmware using the XCC Redfish REST API for ThinkSystem servers
Description
Lenovo XClarity Controller (XCC) provides support for the industry-standard Redfish Scalable Platforms Management API which can be used to access XCC data and services from applications running outside XCC. Redfish uses RESTful interface semantics and JSON resource payloads to perform system management through Web-based protocols.
This article introduces the procedure used to update system firmware using the XCC Redfish REST API.
The following HTTP methods will be used in this article:
- GET: read request – used to request a specified resource or collection to check data
- POST: action request – used to initiate operations or create resources
Applicable Systems
ThinkSystem (Except HR330A, HR350A, HR630X, HR650X), SR645, SR665
Prerequisites
- A Redfish client must be installed on your workstation or laptop.
- Redfish clients:
- Chrome: Postman, Talend API Tester
- Firefox: RESTClient
- The workstation or laptop must have direct network access to XCC on the target server.
Procedures
Use the following steps to update the system firmware levels using the XCC Redfish API method.
Download the desired firmware packages
- Download the appropriate firmware package for your machine from the Lenovo support page.
- Unzip the files and copy the contents to a specified folder.
Retrieve the installed firmware versions
- To access the properties in the firmware inventory collection, open postman, select the GET method ① and then enter the following requested URL ②: https://BMCIP/redfish/v1/UpdateService/FirmwareInventory
- In the Authorization tab, select Basic Auth from the Type menu ③, and then enter the BMC credentials ④. Click Send ⑤.
Note: This authorization step is required for each request.
Response example
If the request is successful, a message body similar to the following will be returned:
{
"Members": [
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/BMC-Primary"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/BMC-Backup"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/UEFI"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/LXPM"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/LXPMWindowsDriver"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/LXPMLinuxDriver"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Ob_1.Bundle"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Slot_4.Bundle"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Ob_5.Bundle"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Ob_4.Bundle"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Ob_1.1"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Ob_1.2"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Slot_4.1"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Disk1"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Disk2"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Disk3"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Disk4"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Disk5"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/Disk6"
},
{
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/PSU1"
}
],
"@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection",
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory",
"Members@odata.count": 20,
"@odata.etag": "\"af76d20eb1af2e197f855\"",
"Name": "SoftwareInventoryCollection",
"Description": "Firmware Inventory Collection."
}
- From the output of the Members list, find the system firmware endpoint that you want to query – for example, /redfish/v1/UpdateService/FirmwareInventory/UEFI. Enter it into the URL field to get the UEFI information.
{
"ReleaseDate": "2020-09-18T00:00:00Z",
"RelatedItem": [
{
"@odata.id": "/redfish/v1/Systems/1/Bios"
}
],
"Id": "UEFI",
"Status": {
"HealthRollup": "OK",
"Health": "OK",
"State": "Enabled"
},
"Manufacturer": "Lenovo",
"Name": "Firmware:UEFI",
"Version": "60N-2.71",
"SoftwareId": "UEFI-IVE1-6",
"RelatedItem@odata.count": 1,
"@odata.type": "#SoftwareInventory.v1_2_3.SoftwareInventory",
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/UEFI",
"Updateable": true,
"@odata.etag": "\"3d193e9f3c0c2725df0\"",
"LowestSupportedVersion": null,
"Description": "The information of UEFI firmware."
}
In the response data above, the installed UEFI is 60N-2.71 and the software ID is UEFI-IVE1-1.6.
Apply firmware updates
Use the POST method to apply UEFI or XCC updates.
UEFI updates
- Select the POST method, and then enter the following requested URL: https://BMCIP/fwupdate
- In the Body tab for the POST action, select binary, and then select the firmware image to be updated.
- Click Send.
- If the request is successful, the response code status 202 Accepted will be displayed. The message body will be similar to the following example:
In the response example above, /redfish/v1/TaskService/Tasks/00fc5d1b-f3da-469a-a4b0-007e91baa55f is the new task that has just been created. You can use the Get method to query the update status with the task ID.
Requested URL
https://BMCIP/redfish/v1/TaskService/Task/ID
Response example
- Restart the server and perform the firmware inventory again. The BIOS version will have been updated.
You can also use the POST method to perform a system reboot.
Requested URL
https://BMCIP/redfish/v1/Systems/1/Actions/ComputerSystem.Reset
Requested body of the POST action:
{"ResetType":"GracefulRestart"}
# The possible values of the system reset type could be On/ForceOff/GracefulShutdown/GracefulRestart/ForceRestart/Nmu/ForceOn
Response example
The following JSON response will be returned:
None
XCC updates
- Select the POST method, and then enter the following requested URL: https://BMCIP/fwupdate
- In the Body tab for the POST action, select binary, and then select the firmware image to be updated.
- Click Send.
- If the request is successful, the response code status 202 Accepted will be displayed. The message body will be similar to the following example:
In the response example above, /redfish/v1/TaskService/Tasks/d9674179-39e2-4842-8cbe-5d2ce477e49b is the new task that has just been created. You can use the Get method to query the update status with the task ID.
Requested URL
https://BMCIP/redfish/v1/TaskService/Task/ID
Response example
- Restart the server and perform the firmware inventory again. The XCC version will have been updated.
You can also use the POST method to restart XCC.
Requested URL
https://BMCIP/redfish/v1/Managers/1/Actions/Manager.Reset
Requested body of the POST action:
{"ResetType":"GracefulRestart"}
# The possible values of the XCC reset type could be GracefulRestart/ForceRestart
Response example
The following JSON response will be returned:
None