Purpose:
- Redfish is more secure since it uses HTTPS instead of IPMI’s unencrypted approach.
- For future management, it is recommended to migrate
ipmitool
to Redfish API. - If the system supports Redfish, use
ResetType: ForceRestart
instead ofipmitool power cycle
Target Audience:
For those engineer(s) who will use the Redfish client and Redfishtool to manage the Redfish-supported hardware, the engineer(s) shall understand the Redfish API and how to run the text command under Windows 10 PowerShell.
Pre-requirement:
1. Linux base system with curl command
Procedures:
The ipmitool power cycle
command performs a shutdown followed by a restart. In Redfish, this corresponds to ResetType: ForceRestart
or ResetType: PowerCycle
.
Method 1: Using Redfish CLI
If you have the DMTF Redfish CLI tool, you can execute the reboot with the following command:
refer to How to install DMTF / python-redfish-library and use it on Windows 10.
redfishtool -r <BMC_IP> -u <username> -p <password> Systems Reset ForceRestart
This performs the same function as ipmitool power cycle
, forcing a server restart.
Method 2: Using Redfish API
You can send a POST request via Redfish API to trigger a server reboot:
🔹 API Request
curl -k -X POST "https://<BMC_IP>/redfish/v1/Systems/<System_ID>/Actions/ComputerSystem.Reset" \
-H "Content-Type: application/json" \
-d '{"ResetType": "ForceRestart"}' \
-u <username>:<password>
Parameter Explanation
-
<BMC_IP>
: BMC's IP address -
<System_ID>
: System identifier, usually"0"
, so the endpoint is/redfish/v1/Systems/0
-
ResetType
options:-
"ForceRestart"
→ Force reboot (equivalent toipmitool power cycle
) -
"GracefulRestart"
→ Graceful shutdown and restart -
"ForceOff"
→ Force shutdown -
"PowerCycle"
→ Full power cycle (cold reboot equivalent)
-
🔹 Check if the Redfish service is on or not via https:// <BMC IP>/redfish/v1/
🔹 Redfish Equivalent of ipmitool power on
$ curl -i -k -u administrator:advantech "https://172.17.10.136/redfish/v1/Systems/0/Actions/ComputerSystem.Reset" -H "Content-Type: application/json" -X POST -d '{"ResetType": "On"}'
HTTP/2 204
odata-version: 4.0
www-authenticate: Basic realm="administrator"
allow: POST
cache-control: no-cache
access-control-allow-origin: *
content-type: application/json
content-security-policy: default-src 'self'; script-src 'none'; style-src 'self' 'unsafe-inline'; font-src 'self'; frame-ancestors 'none'; object-src 'none'; connect-src 'self' ws:; script-src-elem 'self'
strict-transport-security: max-age=31536000; includeSubdomains;
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-permitted-cross-domain-policies: none
referrer-policy: no-referrer
cross-origin-resource-policy: same-origin
date: Wed, 05 Mar 2025 06:32:04 GMT
server: lighttpd
🔹 Check power status
$ curl -s -i -k -u administrator:advantech "https://172.17.10.136/redfish/v1/Systems/0" | grep "PowerState"
"PowerState":"On",
🔹 Redfish Equivalent of ipmitool power off
$ curl -i -k -u administrator:advantech "https://172.17.10.136/redfish/v1/Systems/0/Actions/ComputerSystem.Reset" -H "Content-Type: application/json" -X POST -d '{"ResetType": "ForceOff"}'
HTTP/2 204
odata-version: 4.0
www-authenticate: Basic realm="administrator"
allow: POST
cache-control: no-cache
access-control-allow-origin: *
content-type: application/json
content-security-policy: default-src 'self'; script-src 'none'; style-src 'self' 'unsafe-inline'; font-src 'self'; frame-ancestors 'none'; object-src 'none'; connect-src 'self' ws:; script-src-elem 'self'
strict-transport-security: max-age=31536000; includeSubdomains;
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-permitted-cross-domain-policies: none
referrer-policy: no-referrer
cross-origin-resource-policy: same-origin
date: Wed, 05 Mar 2025 06:35:45 GMT
server: lighttpd
🔹 Redfish Equivalent of ipmitool power cycle
$ curl -i -k -u administrator:advantech "https://172.17.10.136/redfish/v1/Systems/0/Actions/ComputerSystem.Reset" -H "Content-Type: application/json" -X POST -d '{"ResetType": "PowerCycle"}'
HTTP/2 204
odata-version: 4.0
www-authenticate: Basic realm="administrator"
allow: POST
cache-control: no-cache
access-control-allow-origin: *
content-type: application/json
content-security-policy: default-src 'self'; script-src 'none'; style-src 'self' 'unsafe-inline'; font-src 'self'; frame-ancestors 'none'; object-src 'none'; connect-src 'self' ws:; script-src-elem 'self'
strict-transport-security: max-age=31536000; includeSubdomains;
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-permitted-cross-domain-policies: none
referrer-policy: no-referrer
cross-origin-resource-policy: same-origin
date: Wed, 05 Mar 2025 06:39:32 GMT
server: lighttpd
For more details about how to use the Redfish Tool, please refer to the Advantech website:
Registrator the ID by yourself.
Download the correct version and check by following command
$ curl -s -i -k "https://172.17.10.136/redfish/v1" | grep -i redfishsoftwareversion
"RedfishSoftwareVersion":"8.1.0"
Comments
0 comments
Please sign in to leave a comment.