<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CIMC XML API Change in Behavior for 0 day Provisioning in Unified Computing System (UCS)</title>
    <link>https://community.cisco.com/t5/unified-computing-system-ucs/cimc-xml-api-change-in-behavior-for-0-day-provisioning/m-p/4864678#M60</link>
    <description>&lt;P&gt;Are you able to share a redacted version of your XML requests?&amp;nbsp; I believe it was first tightened up in 4.2(3b) with internal enhancement&amp;nbsp;CSCwc46717.&lt;/P&gt;
&lt;P&gt;I haven't tested personally myself, but according to the notes this was used for validation (and if you are specifying any additional attributes other than name/id/pwd it'll fail until after the password is changed):&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;curl -k -d '
&amp;lt;configConfMo cookie="xxx/yy-zzz" dn="sys/user-ext/user-1" inHierarchical="false"&amp;gt;
&amp;lt;inConfig&amp;gt;
&amp;lt;aaaUser name="admin" id="1" pwd="TheNewPassword" &amp;gt;&amp;lt;/aaaUser&amp;gt;
&amp;lt;/inConfig&amp;gt;
&amp;lt;/configConfMo&amp;gt;
' https://cimc_ip/nuova
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you still arent able to change the password with XML even with the syntax above I'd open up a TAC case as I don't believe thats expected behavior.&lt;/P&gt;
&lt;P&gt;Other potential workaround is redfish:&lt;/P&gt;
&lt;P&gt;curl -k -u admin:password &lt;A href="https://cimc_ip/redfish/v1/AccountService/Accounts/1" target="_blank"&gt;https://cimc_ip/redfish/v1/AccountService/Accounts/1&lt;/A&gt; -XPATCH -d '{"Password" : "new-password"}'&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jun 2023 13:35:05 GMT</pubDate>
    <dc:creator>Brian Morrissey</dc:creator>
    <dc:date>2023-06-29T13:35:05Z</dc:date>
    <item>
      <title>CIMC XML API Change in Behavior for 0 day Provisioning</title>
      <link>https://community.cisco.com/t5/unified-computing-system-ucs/cimc-xml-api-change-in-behavior-for-0-day-provisioning/m-p/4864264#M59</link>
      <description>&lt;P class="p1"&gt;I know this isn't the best place for this question, but I don't where is so I'm hoping someone here can direct me. I've had a ZTP type of automation solution for provisioning Cisco UCS rack mount servers which has worked fairly well over the past year. However, this last batch of servers we got appears to have a change in behavior that I'm unable to find documented anywhere and haven't found a workaround for yet.&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;The solution entails a python based provisioning script for the servers that uses CIMC's xml API to login, change the default password, assign a hostname, change the network management mode, and provision drives. The problem with this latest batch which shipped with firmware 4.2(3b) is that logging in via the API now gives me the following error:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;Error: '563': 'Default credentials were used for login. Administrator password needs to be changed to access the services for security purposes.'&lt;/LI-CODE&gt;
&lt;P class="p1"&gt;The message itself is not unusual, as it was presented to the user when using SSH or web interface to login and it forced a password change. That's not the problem, the problem is the behavior is now extended to the API and I can't seem to figure out how to change the password from that state. I'm happy and willing to change the password, but how can I do it over xml?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 22:17:06 GMT</pubDate>
      <guid>https://community.cisco.com/t5/unified-computing-system-ucs/cimc-xml-api-change-in-behavior-for-0-day-provisioning/m-p/4864264#M59</guid>
      <dc:creator>gbekmezi-DD</dc:creator>
      <dc:date>2023-06-28T22:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: CIMC XML API Change in Behavior for 0 day Provisioning</title>
      <link>https://community.cisco.com/t5/unified-computing-system-ucs/cimc-xml-api-change-in-behavior-for-0-day-provisioning/m-p/4864678#M60</link>
      <description>&lt;P&gt;Are you able to share a redacted version of your XML requests?&amp;nbsp; I believe it was first tightened up in 4.2(3b) with internal enhancement&amp;nbsp;CSCwc46717.&lt;/P&gt;
&lt;P&gt;I haven't tested personally myself, but according to the notes this was used for validation (and if you are specifying any additional attributes other than name/id/pwd it'll fail until after the password is changed):&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;curl -k -d '
&amp;lt;configConfMo cookie="xxx/yy-zzz" dn="sys/user-ext/user-1" inHierarchical="false"&amp;gt;
&amp;lt;inConfig&amp;gt;
&amp;lt;aaaUser name="admin" id="1" pwd="TheNewPassword" &amp;gt;&amp;lt;/aaaUser&amp;gt;
&amp;lt;/inConfig&amp;gt;
&amp;lt;/configConfMo&amp;gt;
' https://cimc_ip/nuova
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you still arent able to change the password with XML even with the syntax above I'd open up a TAC case as I don't believe thats expected behavior.&lt;/P&gt;
&lt;P&gt;Other potential workaround is redfish:&lt;/P&gt;
&lt;P&gt;curl -k -u admin:password &lt;A href="https://cimc_ip/redfish/v1/AccountService/Accounts/1" target="_blank"&gt;https://cimc_ip/redfish/v1/AccountService/Accounts/1&lt;/A&gt; -XPATCH -d '{"Password" : "new-password"}'&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 13:35:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/unified-computing-system-ucs/cimc-xml-api-change-in-behavior-for-0-day-provisioning/m-p/4864678#M60</guid>
      <dc:creator>Brian Morrissey</dc:creator>
      <dc:date>2023-06-29T13:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: CIMC XML API Change in Behavior for 0 day Provisioning</title>
      <link>https://community.cisco.com/t5/unified-computing-system-ucs/cimc-xml-api-change-in-behavior-for-0-day-provisioning/m-p/4864876#M61</link>
      <description>&lt;P&gt;Thanks for the reply. The error I’m getting is when I log in. Your code snippet is a password change request. However, what would I use for the cookie value without a successful login before the password request?&lt;BR /&gt;&lt;BR /&gt;Here’s a code snippet from the login function:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;         try:
            response = post_request(self.ipaddress, command_string, timeout=LOGIN_TIMEOUT)
            if 'outCookie' in response.attrib:
                self.session_cookie = response.attrib['outCookie']
            if 'outRefreshPeriod' in response.attrib:
                self.session_refresh_period = response.attrib['outRefreshPeriod']
            if 'outVersion' in response.attrib:
                self.version = response.attrib['outVersion']
            return self&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;George&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 20:59:37 GMT</pubDate>
      <guid>https://community.cisco.com/t5/unified-computing-system-ucs/cimc-xml-api-change-in-behavior-for-0-day-provisioning/m-p/4864876#M61</guid>
      <dc:creator>gbekmezi-DD</dc:creator>
      <dc:date>2023-06-29T20:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: CIMC XML API Change in Behavior for 0 day Provisioning</title>
      <link>https://community.cisco.com/t5/unified-computing-system-ucs/cimc-xml-api-change-in-behavior-for-0-day-provisioning/m-p/4864886#M62</link>
      <description>&lt;P&gt;Curious to see what the sending value of command_string is as you should be getting the cookie back, does something like this still work with curl?&lt;BR /&gt;curl -k -d "&amp;lt;aaaLogin inName='admin' inPassword='thepassword'/&amp;gt;" &lt;A href="https://cimc_ip/nuova" target="_blank"&gt;https://cimc_ip/nuova&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Response should include a cookie with an additional outstatus telling you it needs to be changed:&lt;BR /&gt;&amp;lt;aaaLogin cookie="" response="yes" outCookie="xxx-yyy-zzz" outRefreshPeriod="600" outPriv="admin" outSessionId="1" outVersion="4.2(3b)" outStatus="Warning : Please change default password."&amp;gt; &amp;lt;/aaaLogin&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 21:28:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/unified-computing-system-ucs/cimc-xml-api-change-in-behavior-for-0-day-provisioning/m-p/4864886#M62</guid>
      <dc:creator>Brian Morrissey</dc:creator>
      <dc:date>2023-06-29T21:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: CIMC XML API Change in Behavior for 0 day Provisioning</title>
      <link>https://community.cisco.com/t5/unified-computing-system-ucs/cimc-xml-api-change-in-behavior-for-0-day-provisioning/m-p/4864915#M63</link>
      <description>&lt;P&gt;I'm sorry, I thought I included that in my previous reply:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;command_string = f"&amp;lt;aaaLogin inName='{self.username}' inPassword='{self.password}'&amp;gt;&amp;lt;/aaaLogin&amp;gt;"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, I think I found the problem thanks to your feedback. The script I was running retrieves the user list before changing the password and that's the request that was failing. I assumed the failure was the login command because the very next thing I was doing was changing the password, but there was that one little command between the two.&lt;BR /&gt;&lt;BR /&gt;I will test the script again once we have another of servers to provision.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 23:51:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/unified-computing-system-ucs/cimc-xml-api-change-in-behavior-for-0-day-provisioning/m-p/4864915#M63</guid>
      <dc:creator>gbekmezi-DD</dc:creator>
      <dc:date>2023-06-29T23:51:45Z</dc:date>
    </item>
  </channel>
</rss>

