cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1834
Views
10
Helpful
3
Replies

Reset CIMC server with API call

smailmilak
Level 4
Level 4

Hi,

 

I have a bunch of C220 servers connected to the FI's. The OS has to be reinstalled quite often on all of them but every time I have to reset CIMC server on every node manually, otherwise the installation fails.

 

How can I reset the CIMC server on all servers with one simple API call? Doing this manually is time consuming and frustrating.

3 Replies 3

Steven Tardy
Cisco Employee
Cisco Employee

UCSM SDK (https://github.com/CiscoUcs/ucsmsdk) has this ability.

Did a [Reset CIMC] for Server 4 in the lab and saw the request from UCSM Web GUI to UCSM was:

 

<configConfMos cookie="1592922190/45######-####-####-####-##########03" inHierarchical="false">
    <inConfigs>
<pair key="sys/rack-unit-4">
    <computeRackUnit
    adminPower="bmc-reset-immediate"
    id="4"
    dn="sys/rack-unit-4"
    
    status="created,modified"
    
    sacl="addchild,del,mod">
    </computeRackUnit>
</pair>
    </inConfigs>
</configConfMos>

Searching UCSM SDK for adminPower shows the source:

 

https://github.com/CiscoUcs/ucsmsdk/blob/7d721263a67811ad1f8a1576ad22249663eab88e/ucsmsdk/mometa/compute/ComputeRackUnit.py

You'll need a loop to gather all server IDs (eg sys/rack-unit-4 for the above test) then update that MO (managed object) and set adminPower accordingly.

Thanks a lot Steven.

 

I'm not experienced with API calls but I will give my best.

Kirk J
Cisco Employee
Cisco Employee

Greetings.

If you have standalone servers , you can also try:

curl -XPOST -k -u admin:YOURCIMCPASSWORD https://x.x.x.x/redfish/v1/Managers/CIMC/Actions/Manager.Reset -d '{"ResetType":"ForceRestart"}'

or

curl -XPOST -m 5 -k -u admin:YOURCIMCPASSWORD https://x.x.x.x/redfish/v1/Managers/CIMC/Actions/Manager.Reset -d '{"ResetType":"ForceRestart"}'

 

The -m 5 parameter is max time (5 seconds in our case) curl waits.  You might get an error like :

curl: (28) Operation timed out after 5001 milliseconds with 0 bytes received

But the reset command is still completed.

 

Know this doesn't work with UCSM integration, but thought I'd add this here for others looking for similar requests for standalone.

Kirk...

Review Cisco Networking for a $25 gift card

Review Cisco Networking for a $25 gift card