<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: change persistent boot order using Redfish API in ProLiant Servers (ML,DL,SL)</title>
    <link>https://community.hpe.com/t5/proliant-servers-ml-dl-sl/change-persistent-boot-order-using-redfish-api/m-p/7195197#M182919</link>
    <description>&lt;P&gt;Just to summarize:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# 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 &amp;lt;&amp;lt;&amp;lt; $(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|^\(.*\)&amp;amp;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 '.'
 &lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 28 Aug 2023 13:44:50 GMT</pubDate>
    <dc:creator>bradawk1</dc:creator>
    <dc:date>2023-08-28T13:44:50Z</dc:date>
    <item>
      <title>change persistent boot order using Redfish API</title>
      <link>https://community.hpe.com/t5/proliant-servers-ml-dl-sl/change-persistent-boot-order-using-redfish-api/m-p/7194914#M182866</link>
      <description>&lt;P&gt;Trying to change the persistent boot config order array using the redfish api.&amp;nbsp; This is the code I am using:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;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 &amp;lt;&amp;lt;&amp;lt; $(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|^\(.*\)&amp;amp;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 '.'
 &lt;/LI-CODE&gt;&lt;P&gt;I get back:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "error": {
    "code": "iLO.0.10.ExtendedInfo",
    "message": "See @Message.ExtendedInfo for more information.",
    "@Message.ExtendedInfo": [
      {
        "MessageId": "iLO.2.15.SystemResetRequired"
      }
    ]
  }
}&lt;/LI-CODE&gt;&lt;P&gt;I took that to mean there really was not an error, but that a iLO reset was required.&amp;nbsp; I sent the reset command and waited for that to complete.&amp;nbsp; I then pulled down&amp;nbsp; the PersistentBootConfigOrder array again and it had not changed.&amp;nbsp; Any idea what I am doing wrong?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 15:49:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/proliant-servers-ml-dl-sl/change-persistent-boot-order-using-redfish-api/m-p/7194914#M182866</guid>
      <dc:creator>bradawk1</dc:creator>
      <dc:date>2023-08-24T15:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: change persistent boot order using Redfish API</title>
      <link>https://community.hpe.com/t5/proliant-servers-ml-dl-sl/change-persistent-boot-order-using-redfish-api/m-p/7194958#M182876</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&lt;BR /&gt;&lt;BR /&gt;"Actions": {&lt;BR /&gt;"#ComputerSystem.Reset": {&lt;BR /&gt;"ResetType@Redfish.AllowableValues": ["On", "ForceOff", "GracefulShutdown", "ForceRestart", "Nmi", "PushPowerButton", "GracefulRestart"],&lt;BR /&gt;"target": "/redfish/v1/Systems/1/Actions/ComputerSystem.Reset"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 15:43:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/proliant-servers-ml-dl-sl/change-persistent-boot-order-using-redfish-api/m-p/7194958#M182876</guid>
      <dc:creator>thutchings</dc:creator>
      <dc:date>2023-08-24T15:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: change persistent boot order using Redfish API</title>
      <link>https://community.hpe.com/t5/proliant-servers-ml-dl-sl/change-persistent-boot-order-using-redfish-api/m-p/7194959#M182877</link>
      <description>&lt;P&gt;Oh!&amp;nbsp; Thanks!&amp;nbsp; That is more intrusive to operations than I realized.&amp;nbsp; I will make that update.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 15:45:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/proliant-servers-ml-dl-sl/change-persistent-boot-order-using-redfish-api/m-p/7194959#M182877</guid>
      <dc:creator>bradawk1</dc:creator>
      <dc:date>2023-08-24T15:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: change persistent boot order using Redfish API</title>
      <link>https://community.hpe.com/t5/proliant-servers-ml-dl-sl/change-persistent-boot-order-using-redfish-api/m-p/7195197#M182919</link>
      <description>&lt;P&gt;Just to summarize:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# 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 &amp;lt;&amp;lt;&amp;lt; $(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|^\(.*\)&amp;amp;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 '.'
 &lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 28 Aug 2023 13:44:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/proliant-servers-ml-dl-sl/change-persistent-boot-order-using-redfish-api/m-p/7195197#M182919</guid>
      <dc:creator>bradawk1</dc:creator>
      <dc:date>2023-08-28T13:44:50Z</dc:date>
    </item>
  </channel>
</rss>

