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

  1. Download the appropriate firmware package for your machine from the Lenovo support page.
  2. Unzip the files and copy the contents to a specified folder.

Retrieve the installed firmware versions

  1. 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
  2. In the Authorization tab, select Basic Auth from the Type menu, and then enter the BMC credentials . Click Send .

inventory

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."
}
  1. 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

  1. Select the POST method, and then enter the following requested URL: https://BMCIP/fwupdate
  2. In the Body tab for the POST action, select binary, and then select the firmware image to be updated.

fwupdate

  1. Click Send.

send

  1. If the request is successful, the response code status 202 Accepted will be displayed. The message body will be similar to the following example:

202 accepted

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

task completed

task 2

  1. 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
power actions

Response example

The following JSON response will be returned:

None

[Back to top]

XCC updates

  1. Select the POST method, and then enter the following requested URL: https://BMCIP/fwupdate
  2. In the Body tab for the POST action, select binary, and then select the firmware image to be updated.

fwupdate

  1. Click Send.

XCC update

  1. If the request is successful, the response code status 202 Accepted will be displayed. The message body will be similar to the following example:

XCC update applied

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

XCC update completed

XCC update completed 2

  1. 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

[Back to top]

Video

Additional Information

Document ID:HT511484
Original Publish Date:11/20/2020
Last Modified Date:08/20/2024