<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Business Solutions</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_category?p_l_id=&amp;mbCategoryId=2049091" />
  <subtitle>Business solutions, opportunities, challenges, etc. relating to the UCS XML API</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_category?p_l_id=&amp;mbCategoryId=2049091</id>
  <updated>2013-05-18T10:02:16Z</updated>
  <dc:date>2013-05-18T10:02:16Z</dc:date>
  <entry>
    <title>RE: Want an iPhone app for UCS Manager?</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4308696" />
    <author>
      <name>Eric Williams</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4308696</id>
    <updated>2011-08-02T16:45:17Z</updated>
    <published>2011-08-02T16:45:17Z</published>
    <summary type="html">[quote]How do you manage to  turn on the locator led, I cannot make it with the api.[/quote]'
 
Have you looked at goUCS?  With goUCS command "goucs filterlog logtail", you can launch the UCSM GUI, perform a locator LED enable, and the API sent from the UCS GUI to UCSM will be displayed.  FYI, if you are running this against the emulator, the LED states are not emulated, so they will always be shown as "enabled."
 
Eric</summary>
    <dc:creator>Eric Williams</dc:creator>
    <dc:date>2011-08-02T16:45:17Z</dc:date>
  </entry>
  <entry>
    <title>RE: Want an iPhone app for UCS Manager?</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4284633" />
    <author>
      <name>Udo Fholl</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4284633</id>
    <updated>2011-07-28T18:03:58Z</updated>
    <published>2011-07-28T18:03:58Z</published>
    <summary type="html">How do you manage to  turn on the locator led, I cannot make it with the api.</summary>
    <dc:creator>Udo Fholl</dc:creator>
    <dc:date>2011-07-28T18:03:58Z</dc:date>
  </entry>
  <entry>
    <title>TITV Cisco Unified Compute System Parser</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4190369" />
    <author>
      <name>James Conaway</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=4190369</id>
    <updated>2011-07-08T22:51:51Z</updated>
    <published>2011-07-08T22:51:21Z</published>
    <summary type="html">TITV is an open source project aimed to help you to document your UCS 
system. TITV consists of a script which collects information from the 
UCSM via the API. The script parses the XML data and then writes the 
data to a report.
 
https://sourceforge.net/projects/titv/</summary>
    <dc:creator>James Conaway</dc:creator>
    <dc:date>2011-07-08T22:51:21Z</dc:date>
  </entry>
  <entry>
    <title>RE: Want an iPhone app for UCS Manager?</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2458246" />
    <author>
      <name>Tige Phillips</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2458246</id>
    <updated>2010-08-21T05:21:25Z</updated>
    <published>2010-08-21T05:21:25Z</published>
    <summary type="html">[quote]/me wants that App![/quote]
 
It's in the iTunes app store.  Search for "simu ucs".
 
-Tige</summary>
    <dc:creator>Tige Phillips</dc:creator>
    <dc:date>2010-08-21T05:21:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Want an iPhone app for UCS Manager?</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2379999" />
    <author>
      <name>Rajeev Karamchedu</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2379999</id>
    <updated>2010-07-23T23:19:08Z</updated>
    <published>2010-07-23T23:19:08Z</published>
    <summary type="html">/me wants that App!</summary>
    <dc:creator>Rajeev Karamchedu</dc:creator>
    <dc:date>2010-07-23T23:19:08Z</dc:date>
  </entry>
  <entry>
    <title>VMware SDK code along with UCS XML API</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2357013" />
    <author>
      <name>Christophe Paggen</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2357013</id>
    <updated>2010-07-14T19:23:55Z</updated>
    <published>2010-07-14T19:23:55Z</published>
    <summary type="html">Here's a little piece of code that combines VMware vSphere's Perl SDK with the UCS XML API. I grew tired of always wondering what UCS blade this or that ESX host in vCenter Server corresponds to. This Perl code queries vCenter for hosts in a given cluster and attempts to correlate the UUIDs it found with associated server profiles on a given UCS.
 
The result looks like this:
 
C:\DOCUME~1\cpaggen\Desktop\VMWARE\DEV\scrap&gt;
C:\DOCUME~1\cpaggen\Desktop\VMWARE\DEV\scrap&gt;perl clusters.pl --server 10.48.82.84 --username cpaggen --password cisco --cluster Production --ucs 10.48.58.12
Logged on to UCS 10.48.58.12 [cookie:1279115610/a3919e0d-0588-4b74-98d3-15534fdf399f]
Found 15 associated servers on UCS
Cluster Name: Production
Overall Status: yellow
Number of hosts: 3
Host esxi-prod-001 with deadbeef-0000-0000-1112-000000000000 (Cisco Systems Inc model N20-B6620-1) is  pnDn="sys/chassis-3/blade-1"
Host esx-prod-003 with deadbeef-0000-0000-1111-000000000000 (Cisco Systems Inc model N20-B6620-1) is  pnDn="sys/chassis-3/blade-5"
Host esxi-prod-002 with deadbeef-0000-0000-1113-000000000000 (Cisco Systems Inc model N20-B6620-1) is  pnDn="sys/chassis-1/blade-2"
Logged out of UCS

End Disconnect
 
Here's the source:
 
#!/bin/perl
#
# List actual location of UCS blades in a given VMware cluster
# Search key is UUID as returned by vCenter Server
#
# cpaggen@cisco.com Jul 2010
#
# v1.0 - quality level: "proof-of-concept"
#
#
# usage: perl clusters.pl --server &lt;ip&gt; --username &lt;user&gt; --password &lt;pwd&gt; --cluster &lt;cluster&gt; --ucs &lt;ip&gt;
#
# ensure vcenter and UCS have the same credentials (ideally use LDAP or any centralized cred. store)

use strict;
use VMware:[img]http://mce_host/html/js/editor/http://developer.cisco.comhttp://developer.cisco.com/cisco2-theme/images/emoticons/pac_man.gif[/img]IRuntime;
use VMware:[img]http://mce_host/html/js/editor/http://developer.cisco.comhttp://developer.cisco.com/cisco2-theme/images/emoticons/pac_man.gif[/img]ILib;
use Data:[img]http://mce_host/html/js/editor/http://developer.cisco.comhttp://developer.cisco.com/cisco2-theme/images/emoticons/smile.gif[/img]umper;
use LWP::UserAgent;
use HTTP::Request::Common;
use XML::LibXML;

my %opts = (
   cluster =&gt; {
     type =&gt; "=s",
     help =&gt; "Target Host",
     variable =&gt; "CLUSTER",
     required =&gt; 1,
   },
   ucs =&gt; {
     type =&gt; "=s",
     help =&gt; "UCS IP address",
     variable =&gt; "UCS",
     required =&gt; 1,
   },
);

Opts::add_options(%opts);
Opts::parse();
Util::connect();

my $cluster_name = Opts::get_option('cluster');
my $user = Opts::get_option('username');
my $password = Opts::get_option('password');
my $customFieldsManager = Vim::get_view(mo_ref =&gt; Vim::get_service_content()-&gt;customFieldsManager);
my $cluster_view = Vim::find_entity_view(view_type =&gt; 'ClusterComputeResource',filter =&gt; { name =&gt; $cluster_name });
if(!$cluster_view)
{
 die "Cluster: \"$cluster_name\" was not found on this vCenter Server\n";
}

# Log on to UCS and obtain a cookie

my $browser = LWP::UserAgent-&gt;new(agent =&gt; 'perl post');
my $xmlcmd = "&lt;aaaLogin cookie='null' inName='".$user."' inPassword='".$password."'/&gt;";
my $ucsip = Opts::get_option('ucs');
my $url = 'http://'.$ucsip.'/nuova';
my $xml_header = "&lt;?xml version='1.0'?&gt;";
my $request = HTTP::Request-&gt;new(POST =&gt; $url);
$request-&gt;content_type("text/xml; charset=utf-8");
$request-&gt;content($xmlcmd);

my $response = $browser-&gt;request($request);
if ($response-&gt;content =~ m/errorDescr=\"([a-zA-Z0-9_\-\. ]+)\".*/)
{
    die ("Login failure: ".$1."\n");
}

$response-&gt;content =~ m/outCookie=\"(\d{10}\/\w{8}\-\w{4}\-\w{4}\-\w{4}\-\w{12})\".*/;
my $ucscookie = $1;

# Retrieve list of associated server profiles on UCS

my $xmlcmd = "&lt;configResolveClass cookie='" . $ucscookie . "' classId='lsServer'&gt;
                &lt;inFilter&gt;
                  &lt;eq class='lsServer' property='assocState' value='associated' /&gt;
                &lt;/inFilter&gt;
              &lt;/configResolveClass&gt;";
$request-&gt;content($xmlcmd);
$response = $browser-&gt;request($request);
my $parser = XML::LibXML-&gt;new();
my $xmlDoc = $parser-&gt;parse_string($response-&gt;content);
my $root = $xmlDoc-&gt;getDocumentElement();
my $topnode = $root-&gt;nodeName();
my @servers = $root-&gt;getElementsByLocalName("lsServer");
my %ucsuuids = ();

# Extract UUIDs from list of servers

foreach (@servers)
{
 # the XML attribute is actually uuid="...", we are extracting the actual UUID
 my $rawkey=$_-&gt;getAttributeNode("uuid")-&gt;toString(0);
 if ($rawkey =~ m/uuid=\"([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})\"/)
 {
 my $val=$_-&gt;getAttributeNode("pnDn")-&gt;toString(0);
 $ucsuuids{$1} = $val;
 }
}

print "Logged on to UCS " . $ucsip . " [cookie:" . $ucscookie . "]\n";
print "Found ". scalar(@servers) ." associated servers on UCS \n";
print "Cluster Name: " . $cluster_view-&gt;name ."\n";
print "Overall Status: " . $cluster_view-&gt;overallStatus-&gt;val ."\n";
print "Number of hosts: " . $cluster_view-&gt;summary-&gt;numHosts ."\n";

# Query vCenter Server - if uuid is found as hash key then value contains UCS blade location

my $hosts = Vim::get_views (mo_ref_array =&gt; $cluster_view-&gt;host);
foreach my $host (@$hosts)
{
  my $host_hardware = $host-&gt;hardware-&gt;systemInfo;
  my $uuid=$host_hardware-&gt;uuid;
  printf("Host %s (%s) (%s model %s) is at%s\n",$host-&gt;name, $uuid, $host_hardware-&gt;vendor, $host_hardware-&gt;model, $ucsuuids{$uuid});
}

# Logout of UCS

my $xmlcmd = "&lt;aaaLogout inCookie='" . $ucscookie . "'/&gt;";
$request-&gt;content($xmlcmd);
$response = $browser-&gt;request($request);
print "Logged out of UCS\n";</summary>
    <dc:creator>Christophe Paggen</dc:creator>
    <dc:date>2010-07-14T19:23:55Z</dc:date>
  </entry>
  <entry>
    <title>RE: Want an iPhone app for UCS Manager?</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2345563" />
    <author>
      <name>Fred Crable</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2345563</id>
    <updated>2010-07-09T23:50:26Z</updated>
    <published>2010-07-09T23:50:26Z</published>
    <summary type="html">I got the skills, but will they pay the bills :P</summary>
    <dc:creator>Fred Crable</dc:creator>
    <dc:date>2010-07-09T23:50:26Z</dc:date>
  </entry>
  <entry>
    <title>RE: Want an iPhone app for UCS Manager?</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2164717" />
    <author>
      <name>Tige Phillips</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2164717</id>
    <updated>2010-05-04T23:59:27Z</updated>
    <published>2010-05-04T23:59:27Z</published>
    <summary type="html">You got a really old screen-shot Brian.  </summary>
    <dc:creator>Tige Phillips</dc:creator>
    <dc:date>2010-05-04T23:59:27Z</dc:date>
  </entry>
  <entry>
    <title>UCS Service Profile Use Cases</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2132971" />
    <author>
      <name>Brian Schwarz</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2132971</id>
    <updated>2010-04-24T07:05:33Z</updated>
    <published>2010-04-24T07:05:33Z</published>
    <summary type="html">The attached pdf includes a few slides that give some use case examples around UCS Service Profiles.
 
Service Profiles are the "atomic unit" of UCS, meaning the management system is really built around this as the core object, similar to what a port might be on a switch, or a LUN might be on a SAN array. 
 
Feel free to add a few of your own examples to this forum.</summary>
    <dc:creator>Brian Schwarz</dc:creator>
    <dc:date>2010-04-24T07:05:33Z</dc:date>
  </entry>
  <entry>
    <title>Want an iPhone app for UCS Manager?</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2087453" />
    <author>
      <name>Brian Schwarz</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2087453</id>
    <updated>2010-04-02T06:54:01Z</updated>
    <published>2010-04-02T06:54:01Z</published>
    <summary type="html">Attached screenshot.
 
Sent to me by a creative member of the Cisco field team.
 
Know the iPhone API?
Know UCS XML API?
 
 maybe you can make a little $ by publishing on the AppStore.

If anyone creates an app please post here.
 
The UCS Product Team will provide mystery awards for good submissions.
 
-Brian</summary>
    <dc:creator>Brian Schwarz</dc:creator>
    <dc:date>2010-04-02T06:54:01Z</dc:date>
  </entry>
</feed>

