06-23-2020 12:45 AM
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.
06-23-2020 08:08 AM
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:
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.
06-24-2020 01:59 AM
Thanks a lot Steven.
I'm not experienced with API calls but I will give my best.
06-24-2020 11:26 AM - edited 06-24-2020 05:55 PM
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...
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide