- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- ProLiant Servers (ML,DL,SL)
- >
- change persistent boot order using Redfish API
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 04:28 AM - last edited on 08-24-2023 08:49 AM by support_s
08-24-2023 04:28 AM - last edited on 08-24-2023 08:49 AM by support_s
Trying to change the persistent boot config order array using the redfish api. This is the code I am using:
SERVER=my-fqdn.org
ACTV=$(python3 -c "import urllib.parse, sys; print urllib.parse.quote(sys.argv[1])"'serverName' = '${SERVER}'\"")
UUID=$(curl --insecure --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --silent \
--request GET ${OneView}/rest/server-hardware?filter=${ACTV} | jq -r '.members[] | .uuid'})
read iLOSSO iLOAuth <<< $(curl --silent --insecure --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" \
--request GET ${OneView}/rest/server-hardware/${UUID}/remoteConsoleUrl | \
jq -r '.remoteConsoleUrl ' | sed -e 's|hplocons|https|' -e 's|addr=||' \
-e 's|^\(.*\)&sessionkey=\(.*\)$|\1 \2|')
PBCO=$(curl --insecure --silent --header "X-API-Token: ${iLOAuth}" --request GET ${iLOSSO}/redfish/v1/systems/1/bios/oem/hpe/boot | jq -r '.PersistentBootConfigOrder')
#
# Change the order of the array:
PBCOn=${"PersistentBootConfigOrder":["'$(echo ${PBCO} | jq -r ".[0]")]","'$(echo ${PBCO} | jq -r ".[2]")]","'$(echo ${PBCO} | jq -r ".[1]")]","'$(echo ${PBCO} | jq -r ".[3]")]","'$(echo ${PBCO} | jq -r ".[4]")]","'$(echo ${PBCO} | jq -r ".[5]")'"]}'
echo ${PBCOn} | jq -r '.'
#
# Upload to iLO:
curl --insecure --silent --header "X-API-Token: ${iLOAuth}" --header "content-type: application/json" --data "${PBCOn}" --request PATCH ${iLOSSO}/redfish/v1/systems/1/bios/oem/hpe/boot/settings | jq -r '.'
#
curl --insecure --silent --header "X-API-Token: ${iLOAuth}" --header "content-type: application/json" --data '{"Action": "Manager.Reset"}' --request POST ${iLOSSO}/redfish/v1/Managers/1/Actions/Manager.Reset | jq -r '.'
I get back:
{
"error": {
"code": "iLO.0.10.ExtendedInfo",
"message": "See @Message.ExtendedInfo for more information.",
"@Message.ExtendedInfo": [
{
"MessageId": "iLO.2.15.SystemResetRequired"
}
]
}
}
I took that to mean there really was not an error, but that a iLO reset was required. I sent the reset command and waited for that to complete. I then pulled down the PersistentBootConfigOrder array again and it had not changed. Any idea what I am doing wrong?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 08:43 AM
08-24-2023 08:43 AM
SolutionHello,
In order to apply this change it does not require an iLO reset. A system (server) reset is required to apply a change to BIOS settings. You should be able to do this with the following:
"Actions": {
"#ComputerSystem.Reset": {
"ResetType@Redfish.AllowableValues": ["On", "ForceOff", "GracefulShutdown", "ForceRestart", "Nmi", "PushPowerButton", "GracefulRestart"],
"target": "/redfish/v1/Systems/1/Actions/ComputerSystem.Reset"
}
Regards
I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 08:45 AM
08-24-2023 08:45 AM
Re: change persistent boot order using Redfish API
Oh! Thanks! That is more intrusive to operations than I realized. I will make that update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 06:44 AM
08-28-2023 06:44 AM
Re: change persistent boot order using Redfish API
Just to summarize:
# Get the current boot order:
SERVER=my-fqdn.org
ACTV=$(python3 -c "import urllib.parse, sys; print urllib.parse.quote(sys.argv[1])"'serverName' = '${SERVER}'\"")
UUID=$(curl --insecure --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --silent \
--request GET ${OneView}/rest/server-hardware?filter=${ACTV} | jq -r '.members[] | .uuid'})
read iLOSSO iLOAuth <<< $(curl --silent --insecure --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" \
--request GET ${OneView}/rest/server-hardware/${UUID}/remoteConsoleUrl | \
jq -r '.remoteConsoleUrl ' | sed -e 's|hplocons|https|' -e 's|addr=||' \
-e 's|^\(.*\)&sessionkey=\(.*\)$|\1 \2|')
PBCO=$(curl --insecure --silent --header "X-API-Token: ${iLOAuth}" --request GET ${iLOSSO}/redfish/v1/systems/1/bios/oem/hpe/boot | jq -r '.PersistentBootConfigOrder')
#
# Change the order of the array:
PBCOn=${"PersistentBootConfigOrder":["'$(echo ${PBCO} | jq -r ".[0]")]","'$(echo ${PBCO} | jq -r ".[2]")]","'$(echo ${PBCO} | jq -r ".[1]")]","'$(echo ${PBCO} | jq -r ".[3]")]","'$(echo ${PBCO} | jq -r ".[4]")]","'$(echo ${PBCO} | jq -r ".[5]")'"]}'
echo ${PBCOn} | jq -r '.'
#
# Upload to the server:
curl --insecure --silent --header "X-API-Token: ${iLOAuth}" --header "content-type: application/json" --data "${PBCOn}" --request PATCH ${iLOSSO}/redfish/v1/systems/1/bios/oem/hpe/boot/settings | jq -r '.'
#
# Send a reboot command to the server to activate the change(s):
curl --insecure --silent --header "X-API-Token: ${iLOAuth}" --header "content-type: application/json" --data '{"ResetType": "GracefulRestart"}' --request POST ${iLOSSO}/redfish/v1/systems/1/actions/Computersystem.Reset | jq -r '.'