cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5878
Views
2
Helpful
14
Replies

Error while configuring CIMC network using Standalone C-Series CIMC XML API

raghusiddarth
Level 1
Level 1

Hi,

I'm trying to use the C-series xml api to retrieve and configure Cisco CIMC. I'm following this document : https://communities.cisco.com/docs/DOC-36278?expandComment=true

I've got authenticaiton and retrieval working but configuring using the configConfMo method is failing. This is the document that I'm sending :

<configConfMo cookie="1384164530/eb28c8c8-eae3-1ae3-800a-2185ce9bca70" dn="sys/rack-unit-1/mgmt/if-1">

<inConfig>

    <mgmtIf dn="sys/rack-unit-1/mgmt/if-1"

        extIp="172.1.1.22"

        extMask="255.255.255.0"

        extGw="172.1.1.1"

        dnsUsingDhcp="no"

        dhcpEnable="no"

        nicMode="dedicated"

        nicRedundancy="none">

    </mgmtIf>

</inConfig>

</configConfMo>

and I get the following error :

XML PARSING ERROR: Element 'mgmtIf': This element is not expected. Expected is one of ( managedObject, computeRackUnit, solIf,

equipmentLocatorLed, sysdebugMEpLog, commSnmp, commSnmpTrap, commSsh, commHttp, commHttps ).

Any idea where the error is? Or does the api not support configuring the management interface? Thanks.

14 Replies 14

Jeffrey Foster
Cisco Employee
Cisco Employee

Hi Raghu,

I just ran a similar experiment where I queried my network configuration and then turned around and used these same settings to (re)configure my CIMC. There are a few differences in our statements:

- I have an "inHierarchial='false'" reference

- You have two references to the dn - I did not include the second.

- We chose different ways to close the mgmtIf tag

Please let me know if this was helpful and if so, I will ask our documentation team to add the sample below to the document. Cheers!

Jeff Foster

Input:

sjc-vpn6-436:~ jeffreyfoster$ curl -d "<aaaLogin inName='admin' inPassword='password'></aaaLogin>" http://10.29.131.105/nuova

Response:

<aaaLogin cookie="" response="yes" outCookie="1384226552/5bf95de8-eaf2-1af2-8019-d75a6d0df730" outRefreshPeriod="600" outPriv="admin" outSessionId="25" outVersion="1.5(2)"> </aaaLogin>

Input:

sjc-vpn6-436:~ jeffreyfoster$ curl -d "<configConfMo cookie='1384226552/5bf95de8-eaf2-1af2-8019-d75a6d0df730'  inHierarchical='false'  dn='sys/rack-unit-1/mgmt/if-1'><inConfig><mgmtIf extIp='10.29.131.105' extMask='255.255.255.0' extGw='10.29.131.1' hostname='ucs-c24-m3' dhcpEnable='no' dnsUsingDhcp='no' dnsPreferred='0.0.0.0' dnsAlternate='0.0.0.0' nicMode='shared_lom' nicRedundancy='active-active' vlanEnable='no'/></inConfig></configConfMo>" http://10.29.131.105/nuova

Response:

<configConfMo dn="sys/rack-unit-1/mgmt/if-1" cookie="1384226552/5bf95de8-eaf2-1af2-8019-d75a6d0df730" response="yes"><outConfig><mgmtIf dn="sys/rack-unit-1/mgmt/if-1" description="Management Interface Network Settings" id="1" extEnabled="yes" extIp="10.29.131.105" extMask="255.255.255.0" extGw="10.29.131.1" ifType="physical" mac="30:F4:0D:3D:5A:D5" hostname="ucs-c24-m3" dhcpEnable="no" dnsUsingDhcp="no" dnsPreferred="0.0.0.0" dnsAlternate="0.0.0.0" nicMode="shared_lom" nicRedundancy="active-active" vlanEnable="no" vlanId="1" vlanPriority="0" portProfile="" subject="blade" status="modified" ></mgmtIf></outConfig>

</configConfMo>

Thanks for your reply.

Its still not working, I tried the following :

$ curl --insecure -d '<configConfMo cookie="1384246258/f2877e58-eaf6-1af6-8015-2185ce9bca70" inHierarchical="false" dn="sys/rack-unit-1/mgmt/if-1"><inConfig><mgmtIf extIp="172.18.138.22" extMask="255.255.255.0" extGw="172.18.138.1" dnsUsingDhcp="no" dhcpEnable="no" nicMode="dedicated" nicRedundancy="none"/></inConfig></configConfMo>' -H 'Content-Type: application/xml' https://172.18.138.22/nuova

XML PARSING ERROR: Element 'mgmtIf': This element is not expected. Expected is one of ( managedObject, computeRackUnit, solIf, equipmentLocatorLed, sysdebugMEpLog, commSnmp, commSnmpTrap, commSsh, commHttp, commHttps ).

This is on a C210 M2 with firmware version 1.4(2).

The output seems to suggest that there is problem with the xml document that is being sent, but it looks fine to me.

Hi Raghu,

The XML API in CIMC 1.4 is largely read only with only a couple classes supporting configuration which is why you are recieving this error message.There are more recent versions of CIMC FW available for the C210 - the latest being 1.4(3U) which is avaialble at Cisco.com.  The XML API capabilities have been expanded in CIMC 1.5 which is supported on all our M3 platforms as well as our C260M2 and C460 M2.  The document that you referenced above is specific to the classes and methods that are available int he XML API for CIMC v1.5.

Jeff

Also, is the Python SDK out? Can I get access to the SDK? Thanks.

Hi Raghu,

We do have a beta version of our Python SDK for UCS Manager available (v0.5) on Cisco Communities here:

https://communities.cisco.com/docs/DOC-37174

We do have this planned for our C-Series Servers as well and the links will be posted in that same place and this will be announced via a blog post when it is available. The best way to stay up to date on our announcements and releases is to sign up for E-mail alerts on our Cisco Communities sites (UCS and UCS Integrations).

Cheers!

Jeff

Thanks, the network configuration is working on a system with the 1.5(f) firmware. But, now I get a similar error when I try to add new users :

I'm sending :

<configConfMo cookie="1384855148/b7342160-eb84-1b84-800d-ec716f74ad7c" inHierarchical="true" dn="sys/user-ext">

<inConfig>

<aaaUserEp dn="sys/user-ext">

<aaaUser name="admin" priv="admin" pwd="" rn="user-1" accountStatus="active"/>

</aaaUserEp>

</inConfig>

</configConfMo>

But I get :

<error cookie="" response="yes" errorCode="ERR-xml-parse-error" invocationResult="594" errorDescr="XML PARSING ERROR: Element 'aaaUserEp': This element is not expected. Expected is one of ( managedObject, computeRackUnit, solIf, equipmentLocatorLed, sysdebugMEpLog, commSnmp, commSnmpTrap, commSsh, commNtpProvider, commHttp ). "/>

This is the firmware version I'm using :

ucs-c220-m3# show version

Firmware Version    

--------------------

1.5(1f)  

Can you please check this? Thanks.

Hi Raghu,

Please see my sample below and let me know if you have any additional questions. Cheers!

Jeff Foster

------------------------

Login to System & Get Cookie:

curl -d "<aaaLogin inName='admin' inPassword='password'></aaaLogin>" http://10.29.131.101/nuova

<aaaLogin cookie="" response="yes" outCookie="1384902013/a08983a0-eb8f-1b8f-9230-19b7ad6d2fe0" outRefreshPeriod="600" outPriv="admin" outSessionId="4435" outVersion="1.5(3.34)"> </aaaLogin>

sjc-vpn6-913:~ jeffreyfoster$ curl -d "<configResolveClass classId='aaaUser' cookie='1384902013/a08983a0-eb8f-1b8f-9230-19b7ad6d2fe0' inHierarchical='false' />" http://10.29.131.101/nuova

<configResolveClass cookie="1384902013/a08983a0-eb8f-1b8f-9230-19b7ad6d2fe0" response="yes" classId="aaaUser">

------------------------

Query existing Users:

curl -d "<configResolveClass classId='aaaUser' cookie='1384902013/a08983a0-eb8f-1b8f-9230-19b7ad6d2fe0' inHierarchical='false' />" http://10.29.131.101/nuova

<aaaUser id="1" accountStatus="active" name="admin" priv="admin" pwd="" dn="sys/user-ext/user-1" ></aaaUser><aaaUser id="2" accountStatus="active" name="jeff" priv="user" pwd="" dn="sys/user-ext/user-2" ></aaaUser><aaaUser id="3" accountStatus="active" name="test" priv="admin" pwd="" dn="sys/user-ext/user-3" ></aaaUser><aaaUser id="4" accountStatus="active" name="test2" priv="user" pwd="" dn="sys/user-ext/user-4" ></aaaUser><aaaUser id="5" accountStatus="active" name="test3" priv="admin" pwd="" dn="sys/user-ext/user-5" ></aaaUser><aaaUser id="6" accountStatus="active" name="test4" priv="admin" pwd="" dn="sys/user-ext/user-6" ></aaaUser><aaaUser id="7" accountStatus="active" name="test5" priv="user" pwd="" dn="sys/user-ext/user-7" ></aaaUser><aaaUser id="8" accountStatus="inactive" name="test6" priv="admin" pwd="" dn="sys/user-ext/user-8" ></aaaUser><aaaUser id="9" accountStatus="inactive" name="" priv="" pwd="" dn="sys/user-ext/user-9" ></aaaUser><aaaUser id="10" accountStatus="inactive" name="" priv="" pwd="" dn="sys/user-ext/user-10" ></aaaUser><aaaUser id="11" accountStatus="inactive" name="" priv="" pwd="" dn="sys/user-ext/user-11" ></aaaUser><aaaUser id="12" accountStatus="inactive" name="" priv="" pwd="" dn="sys/user-ext/user-12" ></aaaUser><aaaUser id="13" accountStatus="inactive" name="" priv="" pwd="" dn="sys/user-ext/user-13" ></aaaUser><aaaUser id="14" accountStatus="inactive" name="" priv="" pwd="" dn="sys/user-ext/user-14" ></aaaUser><aaaUser id="15" accountStatus="active" name="andrew" priv="read-only" pwd="" dn="sys/user-ext/user-15" ></aaaUser></outConfigs>

------------------------

Set User:

curl -d "<configConfMo cookie='1384902013/a08983a0-eb8f-1b8f-9230-19b7ad6d2fe0' inHierarchical='false' dn='sys/user-ext/user-11'> <inConfig><aaaUser name='unique' priv='admin' pwd='pass' rn='user-11' accountStatus='active'/></inConfig></configConfMo>" http://10.29.131.101/nuova

<configConfMo dn="sys/user-ext/user-11" cookie="1384902013/a08983a0-eb8f-1b8f-9230-19b7ad6d2fe0" response="yes"><outConfig><aaaUser id="11" accountStatus="active" name="unique" priv="admin" pwd="" dn="sys/user-ext/user-11" status="modified" ></aaaUser></outConfig></configConfMo>

Note: I did check and confirmed that User #11 was created properly.

Thanks Jeffrey. This is working.

So, I've got network, users, sol, console redirection configuration etc working via the xml api. These are all separate xml documents that I construct and send to the servers.

I was wondering, is it possible to send a combined "ConfigConfMo" command or something similar to configure everything at once? Is there any functionality like this? Right now, I have to send a xml "command" for every object I need to change. This takes about 25s for me, compared to 1m12s using cimc cli and expect. Better, but not as fast as I expected it to be.

Hi Raghu,

Glad to hear you got this all working as expected! ConfigConfMos is not a supported method on our CIMC today but we are always looking for opportunities to enhance features/functions and I have captured multi-class query/configuration operations. Thank you for the feedback and please let me know if there is anything further support I can offer. Thank you!

Jeff 

Yes, multiclass config and query would be very helpful, I believe it should reduce the delay considerably.

One last question I had was about the import-config command. I see this available under cimc :

ucs-c220-m3 /cimc/import-export # import-config

  <PROTOCOL>  Protocol to use { tftp | ftp | sftp | scp | http }

What kind of file does this expect? A xml document tree? Thanks.

Hi Raghu,

Yes - This feature allows you to import an XML configuration file and more details on this file and the process of importing this are available here:

http://www.cisco.com/en/US/docs/unified_computing/ucs/c/sw/cli/config/guide/1.5/b_Cisco_UCS_C-series_CLI_Configuration_Guide_151_chapter_01111.html#d68299e695a1635

Jeff

Hi Jeff,

The api is working well for us, but there is one error I encountered today. The xml tree for this box does not contained the MO :

networkAdapterEthIf :

<computeRackUnit adminPower="policy" availableMemory="" dn="sys/rack-unit-1" memorySpeed="" model="UCSC-C220-M3L" name="UCS C220 M3L" numOfAdaptors="0" numOfCores="0" numOfCoresEnabled="0" numOfCpus="0" numOfEthHostIfs="0" numOfFcHostIfs="0" numOfThreads="0" operPower="off" originalUuid="00000000-0000-0000-0000-000000000000" presence="equipped" serial="FCH1726V133" serverId="1" totalMemory="" usrLbl="" uuid="00000000-0000-0000-0000-000000000000" vendor="Cisco Systems Inc">

This is a C220, version 1.5(3) :

C220-FCH1726V133# show version

Firmware Version    

--------------------

1.5(3)

I understand that the api is incomplete in 1.4. But, 1.5 and above is stable, correct? Can you tell me from which version is the cimc xml api considered to be complete? Thanks.

Hi Raghu,

We have continued to enhance and expand the capabilities of the Standalone C-Series XML API and the latest CIMC version 1.5(4) includes the most comprehensive list of capabilities available via this interface. We will continue to build on top of the current set of capabilities going forward to enhance user experience.

I reviewed the output attached in your message and I wanted to check with you to see if you modified the provided output. If not, have you ever powered-on the system (host) as I would expect the values for many of the attributes to be populated in the API output listed above. Additionally, I ran queries for both the computeRackUnit and networkAdapterEthIf classes on a C240 M3 where I was seeing output for both queries with populated data. 

For example, when I ran:

<configResolveClass cookie="1389884688/bf1bf0a0-f017-1017-8113-a1684aa70344" inHierarchical="false" classId="networkAdapterEthIf"/>

I recieve the following response:

<configResolveClass cookie="1389884688/bf1bf0a0-f017-1017-8113-a1684aa70344" response="yes" classId="networkAdapterEthIf"> <outConfigs>

<networkAdapterEthIf id="1" mac="44:02:a6:4b:68:a6" dn="sys/rack-unit-1/network-adapter-L/eth-1" ></networkAdapterEthIf><networkAdapterEthIf id="2" mac="44:02:a6:4b:68:a7" dn="sys/rack-unit-1/network-adapter-L/eth-2" ></networkAdapterEthIf><networkAdapterEthIf id="3" mac="44:02:a6:4b:68:a8" dn="sys/rack-unit-1/network-adapter-L/eth-3" ></networkAdapterEthIf><networkAdapterEthIf id="4" mac="44:02:a6:4b:68:a9" dn="sys/rack-unit-1/network-adapter-L/eth-4" ></networkAdapterEthIf></outConfigs> </configResolveClass>

If you are still seeing the same after powering on the host at least one time, please reach out to me directly via e-mail.

Jeff Foster

Hi Jeff,

Its working now! I had to power on the system first. This is a problem for us though, as we need to get the interface mac addresses before we power on the system. We use the mac to image the systems via pxe. I guess I will have to initiate a power-on before attempting to get the interface details.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: