09-28-2016 11:35 PM
I have to automate the configuration of a number of C240 servers and am trying to use ucsmsdk. I am failing at the first hurdle. I can't work out what I am doing wrong. Can somebody help?
When I try to run the basic test script to login and then logout it fails with a "Not a supported server" error.
Environment
Client written in ucsmsdk v0..9.1.1 working on getting v0.9.2.0 installed.
Server UCS C240 M4S
BIOS C240M4.2.0.9b
CIMC Firmware 2.0(9e)
Test code
from ucsmsdk.ucshandle import UcsHandle
conn = UcsHandle('n.n.n.n', '**username**', '**password**')
conn.login()
When I run this it fails with this exception.
ucsmsdk.ucsexception.UcsLoginError: Not a supportecd server
Debug steps
I have checked that the credentials are correct by altering them and then running the script.
I have also connected to the URI that the ucsmsdk code is using wget.
wget --no-check-certificate http://n.n.n.n:443
I get a compressed (GZIP) CIMC login page. Is this expected?
Thanks for the help.
Solved! Go to Solution.
09-29-2016 02:59 AM
Hi Michael,
ucsmsdk is used to manage UCSM managed rack servers. If you want to manage standalone rack servers, please use imcsdk.
You can install imcsdk using "pip install imcsdk"
Following is the sample code for logging into a standalone rack server using imcsdk :-
from imcsdk.imchandle import ImcHandle
handle = ImcHandle(ip, username, password)
handle.login()
Hope this helps !
09-29-2016 02:59 AM
Hi Michael,
ucsmsdk is used to manage UCSM managed rack servers. If you want to manage standalone rack servers, please use imcsdk.
You can install imcsdk using "pip install imcsdk"
Following is the sample code for logging into a standalone rack server using imcsdk :-
from imcsdk.imchandle import ImcHandle
handle = ImcHandle(ip, username, password)
handle.login()
Hope this helps !
09-29-2016 06:24 AM
And if these are UCS managed C240s, you can use PowerTool to configure anything within UCS. Cisco UCS PowerTool Suite - PowerShell Modules for Cisco UCS Manager, Cisco IMC, UCS Central
10-02-2016 07:18 AM
Thanks for the suggestion but Powershell isn't an option.
10-02-2016 07:27 AM
Thank you for pointing me to the correct Python package. I should get this in the target environment when I am back onsite.
====================
FYI: future readers
In the mean-time, I implemented a quick solution using pexpect to SSH to the IMC but encountered timeouts when attempting to show some Management Objects (e.g. scope chassis, show dimm) despite increasing the timeout to very large values.
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