Use Case Workshop

Report
Unified Computing
System
XML API Integration / Systems Management
Standard Administration Tools
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
1
UCS API Integration
Standard
Administration
Tools
grep / sed
/ more /
less
curl and
xml
NonDisruptive
Integration
Shell
Scripts,
bash / csh
/ ksh / sh
Perl / awk
Firefox –
Poster
add-in
XML
Transform
XSLT
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
2
curl / xml Session Mgmt Example
Tools
• curl – Command-Line URL
• xml – XMLStarlet
Methods
• aaaLogin
• aaaRefresh
• aaaLogout
Session Management
• Conserve resources in the UCS execution environment
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
3
curl / xml Session Example – continued
Login - Get a Cookie
<aaaLogin inName="admin" inPassword="cisco123" />
<aaaLogin cookie="" response="yes"
outCookie="1237375605/d563f79e-5205-4240-b0bc-b65b7aac461d"
outRefreshPeriod="600" outPriv="admin" outDomains="org-root"
outChannel="noencssl" outEvtChannel="noencssl">
</aaaLogin>
Stay Active - Refresh your Cookie
<aaaRefresh inName="admin" inPassword="cisco123"
inCookie="1237375605/d563f79e-5205-4240-b0bc-b65b7aac461d" />
<aaaRefresh cookie="" response="yes" outCookie="1237376246/e2012cdc-7072486c-ab3a-7f8ba58516b4" outRefreshPeriod="600" outPriv="admin"
outDomains="org-root" outChannel="noencssl" outEvtChannel="noencssl">
</aaaRefresh>
Logout – Deactivate your Cookie
<aaaLogout inCookie="1237375605/d563f79e-5205-4240-b0bc-b65b7aac461d" />
<aaaLogout cookie="" response="yes" outStatus="success"> </aaaLogout>
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
4
curl / xml Session Example – continued
aaaLogin
curl
-k –
-H –
-N –
-s –
-d –
Advanced Services
connect to SSL sites without certs
Custom header to pass to server
Disable buffering of the output
Silent mode. Don't output anything
HTTP POST data
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
5
curl / xml Session Example – continued
aaaLogin
xml
fo
sel
-t
-m
-v
Advanced Services
–
–
–
–
–
Format output
Select data or query XML
template named or default
match XPATH expression
print value of XPATH expression
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
6
curl / xml Session Example – continued
aaaRefresh & aaaLogout
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
7
curl / xml Query Example
Tools
• curl – Command-Line URL
• xml – XMLStarlet
Methods
• configResolveClass
Queries
• Retrieve Information about the UCS
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
8
curl / xml Query Example – continued
configResolveClass
curl -k -H "Content-Type: text/xml" -N -s –d
'<configResolveClass
classId="lsServer"
inHierarchical="true"
cookie="1251318687/d201cae3-059a-4c76-baa7-e85fbc0f8496"
/>' https://172.21.60.75/nuova
|
xml sel –t
-m //lsServer[@assignState=\'assigned\']
-s A:T:U @dn
-v "concat('SP: ',@dn,':',@assignState,':',@pnDn,':')"
-m lsPower
-v @state –b –n
curl format remains the same
xml has additional operators
xpath query – [@assignState='assigned']
-s – sort A:T:U
concat – concatenation function
-b – break nesting
-n – print newline
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
9
curl / xml Query Example – continued
configResolveClass – lsServer object
<lsServer agentPolicyName="" assignState="assigned" assocState="associated" bootPolicyName=""
childAction="deleteNonPresent" configQualifier="" configState="applied" descr="ESX 4 Cluster 01 Node 02" dn="orgroot/org-tory_org/ls-esx4-cluster-01-node-02" dynamicConPolicyName="" fltAggr="0" hostFwPolicyName="101e_host_fw"
identPoolName="" intId="138635" localDiskPolicyName="internal-RAID-1" mgmtAccessPolicyName=""
mgmtFwPolicyName="101e_mgmt_fw" name="esx4-cluster-01-node-02" operState="ok" owner="management"
pnDn="sys/chassis-1/blade-8" scrubPolicyName="" solPolicyName="default" srcTemplName=""
statsPolicyName="default" type="instance" uuid="000025b5-0000-0000-0001-000000000002" uuidSuffix="0000000000000000">
<vnicEther adaptorProfileName="" addr="00:25:B5:01:02:02" bootDev="disabled" childAction="deleteNonPresent"
configState="applied" equipmentDn="sys/chassis-1/blade-8/adaptor-1/host-eth-1" fltAggr="0" identPoolName=""
instType="manual" name="eth1" nwTemplName="vnic_b_esx_01" order="2" owner="logical" pinToGroupName=""
qosPolicyName="" rn="ether-eth1" statsPolicyName="default" switchId="B" type="ether">
<vnicEtherIf addr="00:25:B5:01:02:02" childAction="deleteNonPresent" defaultNet="yes" name="default"
operState="indeterminate" owner="logical" rn="if-default" switchId="B" type="ether" vnet="1"/>
<vnicEtherIf addr="00:25:B5:01:02:02" childAction="deleteNonPresent" defaultNet="no" name="vlan700"
operState="indeterminate" owner="logical" rn="if-vlan700" switchId="B" type="ether" vnet="700"/>
</vnicEther>
<vnicFc adaptorProfileName="" addr="20:00:00:25:B5:01:02:01" bootDev="enabled" childAction="deleteNonPresent"
configState="applied" equipmentDn="sys/chassis-1/blade-8/adaptor-1/host-fc-1" fltAggr="0" identPoolName=""
instType="manual" name="fc0" nodeAddr="20:00:00:25:B5:01:02:00" nwTemplName="vhba_a_esx_01" order="3"
owner="logical" persBind="disabled" persBindClear="no" pinToGroupName="" rn="fc-fc0" statsPolicyName="default"
switchId="B" type="fc">
<vnicFcIf childAction="deleteNonPresent" initiator="20:00:00:25:B5:01:02:01" name="vsan10" operState="indeterminate"
owner="logical" rn="if-default" switchId="B" type="fc" vnet="10"/>
</vnicFc>
<lsPower childAction="deleteNonPresent" rn="power" state="up"/>
<lsBinding childAction="deleteNonPresent" computeEpDn="fabric/server/compute-ep-ven-Cisco Systems Inc-mod-N20B6620-1-ser-QCI125200GR" name="pn-binding" pnDn="sys/chassis-1/blade-8" rn="pn"/>
</lsServer>
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
10
curl / xml Query Example – continued
configResolveClass
Response:
SP: org-root/ls-jefhillm-rhel:assigned:sys/chassis-1/blade-4:up
SP: org-root/org-QuickStartRoot/org-Tests/org-Hypervisor/ls-esx4-local_disk:assigned:sys/chassis-1/blade-2:up
SP: org-root/org-tory_org/ls-esx4-cluster-01-node-01:assigned:sys/chassis-1/blade-6:up
SP: org-root/org-tory_org/ls-esx4-cluster-01-node-02:assigned:sys/chassis-1/blade-8:up
Alternate UCS Query that pre filters lsServer based on assignState=assigned alleviates the need for
[@assignedState='assigned'] as part of the XPATH expression
<configResolveClass cookie="1251387546/3b3832e5-d066-40f3-a3b1-bb65789b8de0" inHierarchical="true"
classId="lsServer"><inFilter><eq class="lsServer" property="assignState" value="assigned" /></inFilter>
</configResolveClass>
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
11
curl / xml Configuration Example
Tools
• curl – Command-Line URL
• xml – XMLStarlet
Methods
• configConfMos
Configurations
• Manipulate UCS Objects
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
12
curl / xml Config Example – continued
configConfMos – mgmtBackup object
<configConfMos inHierarchical="true" cookie="1251492362/1177b546-1da1-4f30-8410-6bc6d8c288f7">
<inConfigs>
<pair key="sys/backup-10.98.47.74">
<mgmtBackup adminState="enabled" descr="" dn="sys/backup-10.98.47.74" hostname="10.98.47.74"
proto="tftp" pwd="" remoteFile="ucs-bk1-172.21.60.75-config-system-2009-08-28" status="created"
type="config-system" user=""
/>
</pair>
</inConfigs>
</configConfMos>
<configConfMos cookie="1251492362/1177b546-1da1-4f30-8410-6bc6d8c288f7" response="yes">
<outConfigs>
<pair key="sys/backup-10.98.47.74">
<mgmtBackup adminState="enabled" childAction="deleteNonPresent" descr="" dn="sys/backup10.98.47.74" fsmDescr="" fsmPrev="nop" fsmProgr="100" fsmRmtInvErrCode="none"
fsmRmtInvErrDescr="" fsmRmtInvRslt="" fsmStageDescr="" fsmStamp="never" fsmStatus="backupBegin"
fsmTry="0" hostname="10.98.47.74" intId="157607" job="immediate" name="" postAction="remove"
proto="tftp" pwd="" remoteFile="ucs-bk1-172.21.60.75-config-system-2009-08-28" status="created"
type="config-system" user=""
/>
</pair>
</outConfigs>
</configConfMos>
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
13
curl / xml Config Example – continued
configConfMos
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
14
XML API Potential
Utilize the XML API to Extend UCS Functionality
Manage Multiple UCS Systems
• Overarching system to maintain resource pools, users, policies, etc…
Monitor and Integrate the Event Stream
• Capture events, parse, store, report
• Create event gateway to monitoring solutions
Automate Issue Remediation
• Generate appropriate responses to events
Configuration Backup
• Export entire UCS Information Model
Firmware Image Management
• Ensure Firmware consistency across all components
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
15
Advanced Services
© 2009 Cisco Systems, Inc. All rights reserved.
Cisco Confidential
16

similar documents