This post will explain how to change the boot device with the next boot only option enabled through iRMC Redfish interface. This is equivalent to the IPMI command like "ipmitool chassis bootdev <bootdevice>".
For example, if you want to do a PXE boot to perform an OS installation, you probably execute "ipmitool -H <iRMC address> -U <iRMC username> -P <iRMC password> chassis bootdev pxe". You can request the same to iRMC via Redfish in case you can't use IPMI like for security reasons.
To do this, first you need to check the current settings and the etag information, and then send a request in JSON to iRMC. See below for the steps.
- Send a GET request to the "Systems/0/Oem/ts_fujitsu/BootConfig" endpoint to see the current options and the Etag information.
- Send a PATCH request to the same endpoint. In this example, I use "PXE" as the boot device for the next boot.
$ curl -s -k -u admin:admin -H"Content-Type: application/json" -H"If-Match: 1595025885" -X PATCH https://irmc address/redfish/v1/Systems/0/Oem/ts_fujitsu/BootConfig -d '{"BootDevice": "Pxe", "BootType": "UEFI", "NextBootOnlyEnabled": true}' |jq . { "@odata.context": "/redfish/v1/$metadata#Systems/Members/0/Oem/ts_fujitsu/BootConfig(Name,BootDevice,BootType,NextBootOnlyEnabled)", "@odata.id": "/redfish/v1/Systems/0/Oem/ts_fujitsu/BootConfig", "@odata.type": "http://ts.fujitsu.com/redfish-schemas/v1/FTSSchema.v1_0_0#FTSBootConfig.v1_0_0.FTSBootConfig", "Name": "Boot Configuration", "BootDevice": "Pxe", "BootType": "UEFI", "NextBootOnlyEnabled": true, "@Redfish.Copyright": "Copyright 2017-2018 FUJITSU LIMITED", "@odata.etag": "1595025925" }
Note that I included the "If-Match: <etag data>" option in the request. iRMC will change the boot device if the etag information in the request matches the current value.
$ curl -s -k -u admin:admin -H"Content-Type: application/json" https://irmc address/redfish/v1/Systems/0/Oem/ts_fujitsu/BootConfig |jq '{BootDevice, BootType, NextBootOnlyEnabled, "@odata.etag"}'
{
"BootDevice": "None",
"BootType": "UEFI",
"NextBootOnlyEnabled": false,
"@odata.etag": "1595025885"
}
As you can see, the BootDevice option shows None, so the system is currently booting from the device that is in the top of the boot device list like a local drive. The reason why I displayed the @odata.etag option is that changing the boot device is a PATCH request, so the Etag information needs to be included in the request header. See the next step for details.
If you want to change the boot device to CDROM or bring up BIOS Setup during the next boot, you can just use "Cd" or "BiosSetup" respectively for the BootDevice option.
If you would like to use "BootSourceOverrideTarget" in the Systems/0 endpoint instead of "Systems/0/Oem/ts_fujitsu/BootConfig", send a PATCH request with the data like this to Systems/0.
$ curl -s -k -u admin:admin -H"Content-Type: application/json" -H"If-Match: <etag data>" -X PATCH https://irmc address/redfish/v1/Systems/0 -d '{ "Boot": {"BootSourceOverrideTarget": "Pxe", "BootSourceOverrideEnabled":"Once"}}' |jq '{Boot}'
{
"Boot": {
"BootSourceOverrideTarget": "Pxe",
"BootSourceOverrideTarget@Redfish.AllowableValues": [
"None",
"Pxe",
"Floppy",
"Cd",
"Hdd",
"BiosSetup"
],
"BootSourceOverrideEnabled": "Once",
"BootSourceOverrideEnabled@Redfish.AllowableValues": [
"Once",
"Continuous"
],
"BootSourceOverrideMode": "UEFI"
}
}
No comments:
Post a Comment