Toolset Series

Toolset Series 5 - Redfish® Extended Edition

Welcome back to the Toolset Series, today’s article is about Redfish® once again! After Toolset Series 3 we realised that we still had a lot to share about Redfish®. So here we are, welcome to Toolset Series 5 Redfish® Extended Edition!

Joey Alexander

- 3 min read

Today, we are focusing on real-life examples of using Redfish® with our servers. In this article, Joey Alexander one of Blackcore’s technical specialists will expand on tools that can be used to leverage Redfish and some common examples that our clients would use to read or update server parameters.

Please read Toolset Series 3 before reading this article for additional context on what Redfish® is and how it can be accessed.

As mentioned in Toolset Series 3, Redfish® can be accessed through multiple different ways: A RESTful client such as Nightingale, the command line tool Redfish® tool, or curl. Either way, every command will either send or receive data in JSON format. An example curl request could be:

curl    --request PATCH
        -k --url https://<BMC IP>/redfish/v1/ \
        --user '<username:password>' \
        --header 'If-None-Match: "1710949541"' \
        --header 'Content-Type: application/json' \
        --data @payload.json

 

The following four examples show the desired curl command along with the contents of a separate payload.json file holding the changes we want to make.

Read Sensor Information

Sensor information can be gathered from the Thermal and Power resources. Each has a collection of sensors related to their respective areas. For instance, the Thermal resource might include temperature sensors, fan sensors, etc. To read this data, send a GET request to the desired resource. No JSON body is needed for these GET requests.

curl    --request GET
        -k https://<BMC IP>/redfish/v1/Chassis/Self/Thermal \
        --user '<username:password>'

We receive back a JSON file with all the thermal information related to the system. We can parse this to find specific information such as:

"Temperatures": [
{
"Name": "CPU Package Temp",
"ReadingCelsius": 18
}
]

This shows us the current temperature reading of the CPU.

 

Changing NTP servers

The Network Time Protocol (NTP) server settings can be easily updated using the Redfish protocol. You can send a JSON file including your new desired NTP servers. Here's an example of such a request:

curl    --request PATCH
        -k https://<BMC IP>/redfish/v1/Managers/Self/NetworkProtocol \
        --user  '<username:password>' \
        --header 'If-None-Match: "1710949541"' \
        --header 'Content-Type: application/json' \
        --data @payload.json

payload.json:
{
  "NTP": {
"NTPServers": ["pool.ntp.org", "time.nist.gov”],
"ProtocolEnabled": true
  }
}

This JSON body would set the NTP servers to pool.ntp.org and time.nist.gov. Send this modified JSON body in a PATCH request to the ManagerNetworkProtocol URI.

 

Restarting the system

Restarting the system is conducted through the ComputerSystem resource. Specifically, you need to send a POST request to the Reset action of this resource. The type of reset (e.g., On, ForceOff, GracefulRestart, etc.) is specified in the request's JSON body. For example:

curl    --request PATCH
        -k https://<BMC IP>/redfish/v1/Systems/Self/Actions/ComputerSystem.Reset \
        --user '<username:password>' \
        --header 'If-None-Match: "1710949541"' \
        --header 'Content-Type: application/json' \
        --data @payload.json

payload.json:
{
  "ResetType": "GracefulRestart"
}

This would start a graceful restart of the system.

 

Updating BIOS settings

BIOS settings can be changed by accessing the BIOS/SD resource. In this resource, you'll find an object for each BIOS setting. This ‘SD’ resource allows you to set future BIOS settings which will take effect on the next reboot.

To update a BIOS setting, simply change the desired object in a PATCH request. For instance, to change the boot mode to UEFI, our request might look like this:

curl    --request PATCH
        -k https://<BMC IP>/redfish/v1/Systems/Self/Bios/SD \
        --user '<username:password>' \
        --header 'If-None-Match: "1710949541"' \
        --header 'Content-Type: application/json' \
        --data @payload.json

payload.json:
{
  "Attributes": {
    "BootMode": "Uefi"
  }
}

 

This would change the BootMode setting to UEFI. We could then send a second request to reboot the system, allowing the change to occur.

There are many different BIOS options that can be changed through Redfish®, and the available options depend on the system and even which BIOS version running. For more information on changing BIOS settings, check out our knowledgebase article here.

With these simple steps, you can easily manage and monitor your system with the Redfish® protocol. These are just a few examples of what can be accessed through Redfish®. Make sure to have a look around yourself and you can access the full documentation here.

 

Just remember to always double-check your URIs and JSON bodies to avoid unwanted changes! 

If you would like to learn more about your options for integrating Blackcore with Redfish, please email your account manager. If you are new to Blackcore and would like to learn more, you can email [email protected] or book a call with our CRO Ciaran Kennedy here.

 

 

Joey Alexander

- 3 min read

We use cookies, review our privacy policy here.