HewlettPackard / python-ilorest-library

Python library for interacting with devices which support a Redfish Service
Apache License 2.0
181 stars 89 forks source link

BIOs settings not changed after successful response #135

Closed rdbreak closed 1 year ago

rdbreak commented 1 year ago

Model:

MODEL:         DL360 Gen9
MANUFACTURER:  HP
iLO Firmware Version: 2.80 Jan 25 2022
System ROM: P89 v2.96 (05/17/2022)

BIOs settings BEFORE reboot

check_bios_settings = get(url="https://{oob_ip}/redfish/v1/Systems/1/bios/Settings", json=payload, headers=headers, auth=(oob_username, oob_password), timeout=10)
{
...
    "EmbNicEnable": "Enabled",
...
    "ThermalConfig": "OptimalCooling",
...
}

Request:

payload = {
            "Attributes": {
                "EmbNicEnable":  "Disabled",
                "ThermalConfig": "IncreasedCooling"
                }
            }
headers = {'content-type': 'application/json'}
bios_setting_change = patch(f"https://{oob_ip}/redfish/v1/Systems/1/bios/Settings", json=payload, headers=headers, auth=(oob_username, oob_password), timeout=10)

Response:

 bios_setting_change response code: 200
 bios_setting_change:
{
    "Messages": [
        {
            "MessageID": "iLO.0.10.SystemResetRequired"
        }
    ],
    "Type": "ExtendedError.1.0.0",
    "error": {
        "@Message.ExtendedInfo": [
            {
                "MessageID": "iLO.0.10.SystemResetRequired"
            }
        ],
        "code": "iLO.0.10.ExtendedInfo",
        "message": "See @Message.ExtendedInfo for more information."
    }
}

Reboot system:

payload = {'ResetType': 'ForceRestart'}
headers = {'content-type': 'application/json'}

url = f"https://{systems_uri}['Actions']['#ComputerSystem.Reset']['target']}"
reboot_system = post(url, json=payload, headers=headers, verify=False, auth=(oob_username, oob_password), timeout=10)

System reboots

BIOs settings AFTER reboot

check_bios_settings = get(url="https://{oob_ip}/redfish/v1/Systems/1/bios/Settings", json=payload, headers=headers, auth=(oob_username, oob_password), timeout=10)
{
...
    "EmbNicEnable": "Enabled",
...
    "ThermalConfig": "OptimalCooling",
...
}

Former fix: #12 Related: #105

rajeevkallur commented 1 year ago

This is working as expected. Closing the case.

Please try as below

ilorest -v rawpatch patch.json

patch.json:

{ "/redfish/v1/Systems/1/bios/Settings/": { "Attributes": { "ThermalConfig": "MaxCooling" } } }

rajeevkallur commented 1 year ago

ilorest -v set ThermalConfig=MaxCooling --select Bios. --commit ilorest -v reboot