Recently I am preparing an installation automation for our new Cisco UCS environment which will consist of multiple UCS domains in the near future. As one of the steps, I was trying to power cycle our compute blades via UCS Central Python SDK. Methods are similar to the ones in UCS Manager SDK but separately developed:
srv_obj = handle.query_dn(srv_dn)
srv_obj.admin_power = "cycle-immediate"
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.6/site-packages/ucscsdk-0.9.0.1-py3.6.egg/ucscsdk/ucschandle.py", line 716, in commit
raise UcscException(response.error_code, response.error_descr)
ucscsdk.ucscexception.UcscException: [ErrorCode]: 170[ErrorDescription]: Config server power state via Service Profile is not allowed. Please use server operations to perform power operations.
Apparently the feature was disabled in UCS Central API as the solution to a previous bug that prematurely resets blades: https://quickview.cloudapps.cisco.com/quickview/bug/CSCvp40200
I decided to implement it by finding out the domain information of the blade and triggering a power cycle through directly UCS Manager API instead.