Power Cycle System (Cold Boot) via rest api - Dell Systems Management General Forum - Systems Management - Dell Community
Systems Management Forums

Power Cycle System (Cold Boot) via rest api

Systems Management

Systems Management
Dell Systems Management Solutions: Dell OpenManage, iDRAC, Repository Manager, Microsoft SCCM, Chassis Managment Controller, and more

Power Cycle System (Cold Boot) via rest api

  • Hello,

    How to do Power Cycle System (Cold Boot) via rest api

    Below is example in ILO 

    https://hewlettpackard.github.io/ilo4-rest-api-docs/#log-out-of-a-session

    curl -H "Content-Type: application/json" -X POST --data "@data.json" https://{iLO}/redfish/v1/Systems/1/Actions/ComputerSystem.Reset/ -u username:password --insecure
    

    Contents of data.json

    {“ResetType”: “ColdBoot”}

  • Hi YONI386,

    The command should be similar to the one you used for ILO. Just replace the URI with this - 

  • Post to https://IP/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset 

    {
    "error": {
    "code": "1",
    "message": {
    "lang": "en-us",
    "value": "failed: Unsupported Reset Type:ColdBoot"
    }
    }
    }

    {
    "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem",
    "@odata.id": "/redfish/v1/Systems/System.Embedded.1",
    "@odata.type": "#ComputerSystem.v1_0_2.ComputerSystem",
    "Actions": {
    "#ComputerSystem.Reset": {
    "ResetType@Redfish.AllowableValues": [
    "On",
    "ForceOff",
    "GracefulRestart",
    "PushPowerButton",
    "Nmi"
    ],
    "target": "/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset"
    }
    },
    "AssetTag": "",
    "BiosVersion": "2.3.4",
    "Boot": {
    "BootSourceOverrideEnabled": "Once",
    "BootSourceOverrideTarget": "None",
    "BootSourceOverrideTarget@Redfish.AllowableValues": [
    "None",
    "Pxe",
    "Cd",
    "Floppy",
    "Hdd",
    "BiosSetup",
    "Utilities",
    "UefiTarget",
    "SDCard"
    ],
    "UefiTargetBootSourceOverride": ""
    },
    "Description": "Computer System which represents a machine (physical or virtual) and the local resources such as memory, cpu and other devices that can be accessed from that machine.",
    "EthernetInterfaces": {
    "@odata.id": "/redfish/v1/Systems/System.Embedded.1/EthernetInterfaces"
    },
    "HostName": "",
    "Id": "System.Embedded.1",
    "IndicatorLED": "Off",
    "Links": {
    "Chassis": [
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1"
    }
    ],
    "Chassis@odata.count": 1,
    "CooledBy": [
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.1A"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.2A"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.3A"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.4A"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.5A"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.6A"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.7A"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.1B"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.2B"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.3B"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.4B"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.5B"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.6B"
    },
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Sensors/Fans/0x17||Fan.Embedded.7B"
    }
    ],
    "CooledBy@odata.count": 14,
    "ManagedBy": [
    {
    "@odata.id": "/redfish/v1/Managers/iDRAC.Embedded.1"
    }
    ],
    "ManagedBy@odata.count": 1,
    "PoweredBy": [
    {
    "@odata.id": "/redfish/v1/Chassis/System.Embedded.1/Power/PowerSupplies/PSU.Slot.1"
    }
    ],
    "PoweredBy@odata.count": 1
    },
    "Manufacturer": "Dell Inc.",
    "MemorySummary": {
    "Status": {
    "Health": "OK",
    "HealthRollUp": "OK",
    "State": "Enabled"
    },
    "TotalSystemMemoryGiB": 256
    },
    "Model": "PowerEdge R630",
    "Name": "System",
    "PartNumber": "",
    "PowerState": "On",
    "ProcessorSummary": {
    "Count": 2,
    "Model": "Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz",
    "Status": {
    "Health": "OK",
    "HealthRollUp": "OK",
    "State": "Enabled"
    }
    },
    "Processors": {
    "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Processors"
    },
    "SKU": "",
    "SerialNumber": "",
    "SimpleStorage": {
    "@odata.id": "/redfish/v1/Systems/System.Embedded.1/Storage/Controllers"
    },
    "Status": {
    "Health": "OK",
    "HealthRollUp": "OK",
    "State": "Enabled"
    },
    "SystemType": "Physical",
    "UUID": ""
    }

  • Hi Yoni386,

      Since the valid options as per the output are as below, you could try first a "ForceOff" and then an "On".

    "ResetType@Redfish.AllowableValues": [

    "On",
    "ForceOff",
    "GracefulRestart",
    "PushPowerButton",
    "Nmi"
    ],

    Regards,

    Mondeep

  • Yes, this is what is what I did. I read that five seconds are required between "off" and "on", to make sure all the memory is 100% cleared. 
    The dell ui offer "cold boot". Could be rest api version is not new enough? I can find api reference for cold boot in a single operation. Could be the iDRAC ui is using the same way? off and wait for 5-6t six second and then on? 
  • Hi Yoni386,

      The latest DMTF Redfish schema doc has these as the supported values for ResetType. "ColdBoot" is not one of them. The iDRAC GUI does give the option of "ColdBoot" but I do not know about the implementation.

    <!--Common RestType parameter values for Reset Action-->

    <EnumType Name="ResetType">
    <Member Name="On">
    <Annotation Term="OData.Description" String="Turn the unit on."/>
    </Member>
    <Member Name="ForceOff">
    <Annotation Term="OData.Description" String="Turn the unit off immediately (non-graceful shutdown)."/>
    </Member>
    <Member Name="GracefulShutdown">
    <Annotation Term="OData.Description" String="Perform a graceful shutdown and power off."/>
    </Member>
    <Member Name="GracefulRestart">
    <Annotation Term="OData.Description" String="Perform a graceful shutdown followed by a restart of the system."/>
    </Member>
    <Member Name="ForceRestart">
    <Annotation Term="OData.Description" String="Perform an immediate (non-graceful) shutdown, followed by a restart."/>
    </Member>
    <Member Name="Nmi">
    <Annotation Term="OData.Description" String="Generate a Diagnostic Interrupt (usually an NMI on x86 systems) to cease normal operations, perform diagnostic actions and typically halt the system."/>
    </Member>
    <Member Name="ForceOn">
    <Annotation Term="OData.Description" String="Turn the unit on immediately."/>
    </Member>
    <Member Name="PushPowerButton">
    <Annotation Term="OData.Description" String="Simulate the pressing of the physical power button on this unit."/>
    </Member>
    <Member Name="PowerCycle">
    <Annotation Term="OData.Description" String="Perform a power cycle of the unit."/>
    </Member>
    </EnumType>

    Regards,

    Dell-Mondeep