Unified Computing System XML API Integration Systems Management

  • Slides: 16
Download presentation
Unified Computing System XML API Integration / Systems Management Standard Administration Tools Advanced Services

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

UCS API Integration Standard Administration Tools grep / sed / more / less curl and xml Non-Disruptive 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

curl / xml Session Mgmt Example Tools • curl – Command-Line URL • xml – XMLStarlet Methods • aaa. Login • aaa. Refresh • aaa. Logout 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 <aaa. Login

curl / xml Session Example – continued Login - Get a Cookie <aaa. Login in. Name="admin" in. Password="cisco 123" /> <aaa. Login cookie="" response="yes" out. Cookie="1237375605/d 563 f 79 e-5205 -4240 -b 0 bc-b 65 b 7 aac 461 d" out. Refresh. Period="600" out. Priv="admin" out. Domains="org-root" out. Channel="noencssl" out. Evt. Channel="noencssl"> </aaa. Login> Stay Active - Refresh your Cookie <aaa. Refresh in. Name="admin" in. Password="cisco 123" in. Cookie="1237375605/d 563 f 79 e-5205 -4240 -b 0 bc-b 65 b 7 aac 461 d" /> <aaa. Refresh cookie="" response="yes" out. Cookie="1237376246/e 2012 cdc-7072486 c-ab 3 a-7 f 8 ba 58516 b 4" out. Refresh. Period="600" out. Priv="admin" out. Domains="org-root" out. Channel="noencssl" out. Evt. Channel="noencssl"> </aaa. Refresh> Logout – Deactivate your Cookie <aaa. Logout in. Cookie="1237375605/d 563 f 79 e-5205 -4240 -b 0 bc-b 65 b 7 aac 461 d" /> <aaa. Logout cookie="" response="yes" out. Status="success"> </aaa. Logout> Advanced Services © 2009 Cisco Systems, Inc. All rights reserved. Cisco Confidential 4

curl / xml Session Example – continued aaa. Login curl -k – -H –

curl / xml Session Example – continued aaa. Login 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 aaa. Login xml fo sel -t -m

curl / xml Session Example – continued aaa. Login 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 aaa. Refresh & aaa. Logout Advanced Services

curl / xml Session Example – continued aaa. Refresh & aaa. Logout Advanced Services © 2009 Cisco Systems, Inc. All rights reserved. Cisco Confidential 7

curl / xml Query Example Tools • curl – Command-Line URL • xml –

curl / xml Query Example Tools • curl – Command-Line URL • xml – XMLStarlet Methods • config. Resolve. Class Queries • Retrieve Information about the UCS Advanced Services © 2009 Cisco Systems, Inc. All rights reserved. Cisco Confidential 8

curl / xml Query Example – continued config. Resolve. Class curl -k -H "Content-Type:

curl / xml Query Example – continued config. Resolve. Class curl -k -H "Content-Type: text/xml" -N -s –d '<config. Resolve. Class class. Id="ls. Server" in. Hierarchical="true" cookie="1251318687/d 201 cae 3 -059 a-4 c 76 -baa 7 -e 85 fbc 0 f 8496" />' https: //172. 21. 60. 75/nuova | xml sel –t -m //ls. Server[@assign. State='assigned'] -s A: T: U @dn -v "concat('SP: ', @dn, ': ', @assign. State, ': ', @pn. Dn, ': ')" -m ls. Power -v @state –b –n curl format remains the same xml has additional operators xpath query – [@assign. State='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 config. Resolve. Class – ls. Server object

curl / xml Query Example – continued config. Resolve. Class – ls. Server object <ls. Server agent. Policy. Name="" assign. State="assigned" assoc. State="associated" boot. Policy. Name="" child. Action="delete. Non. Present" config. Qualifier="" config. State="applied" descr="ESX 4 Cluster 01 Node 02" dn="orgroot/org-tory_org/ls-esx 4 -cluster-01 -node-02" dynamic. Con. Policy. Name="" flt. Aggr="0" host. Fw. Policy. Name="101 e_host_fw" ident. Pool. Name="" int. Id="138635" local. Disk. Policy. Name="internal-RAID-1" mgmt. Access. Policy. Name="" mgmt. Fw. Policy. Name="101 e_mgmt_fw" name="esx 4 -cluster-01 -node-02" oper. State="ok" owner="management" pn. Dn="sys/chassis-1/blade-8" scrub. Policy. Name="" sol. Policy. Name="default" src. Templ. Name="" stats. Policy. Name="default" type="instance" uuid="000025 b 5 -0000 -0001 -0000002" uuid. Suffix="00000000"> <vnic. Ether adaptor. Profile. Name="" addr="00: 25: B 5: 01: 02" boot. Dev="disabled" child. Action="delete. Non. Present" config. State="applied" equipment. Dn="sys/chassis-1/blade-8/adaptor-1/host-eth-1" flt. Aggr="0" ident. Pool. Name="" inst. Type="manual" name="eth 1" nw. Templ. Name="vnic_b_esx_01" order="2" owner="logical" pin. To. Group. Name="" qos. Policy. Name="" rn="ether-eth 1" stats. Policy. Name="default" switch. Id="B" type="ether"> <vnic. Ether. If addr="00: 25: B 5: 01: 02" child. Action="delete. Non. Present" default. Net="yes" name="default" oper. State="indeterminate" owner="logical" rn="if-default" switch. Id="B" type="ether" vnet="1"/> <vnic. Ether. If addr="00: 25: B 5: 01: 02" child. Action="delete. Non. Present" default. Net="no" name="vlan 700" oper. State="indeterminate" owner="logical" rn="if-vlan 700" switch. Id="B" type="ether" vnet="700"/> </vnic. Ether> <vnic. Fc adaptor. Profile. Name="" addr="20: 00: 25: B 5: 01: 02: 01" boot. Dev="enabled" child. Action="delete. Non. Present" config. State="applied" equipment. Dn="sys/chassis-1/blade-8/adaptor-1/host-fc-1" flt. Aggr="0" ident. Pool. Name="" inst. Type="manual" name="fc 0" node. Addr="20: 00: 25: B 5: 01: 02: 00" nw. Templ. Name="vhba_a_esx_01" order="3" owner="logical" pers. Bind="disabled" pers. Bind. Clear="no" pin. To. Group. Name="" rn="fc-fc 0" stats. Policy. Name="default" switch. Id="B" type="fc"> <vnic. Fc. If child. Action="delete. Non. Present" initiator="20: 00: 25: B 5: 01: 02: 01" name="vsan 10" oper. State="indeterminate" owner="logical" rn="if-default" switch. Id="B" type="fc" vnet="10"/> </vnic. Fc> <ls. Power child. Action="delete. Non. Present" rn="power" state="up"/> <ls. Binding child. Action="delete. Non. Present" compute. Ep. Dn="fabric/server/compute-ep-ven-Cisco Systems Inc-mod-N 20 B 6620 -1 -ser-QCI 125200 GR" name="pn-binding" pn. Dn="sys/chassis-1/blade-8" rn="pn"/> </ls. Server> Advanced Services © 2009 Cisco Systems, Inc. All rights reserved. Cisco Confidential 10

curl / xml Query Example – continued config. Resolve. Class Response: SP: org-root/ls-jefhillm-rhel: assigned:

curl / xml Query Example – continued config. Resolve. Class Response: SP: org-root/ls-jefhillm-rhel: assigned: sys/chassis-1/blade-4: up SP: org-root/org-Quick. Start. Root/org-Tests/org-Hypervisor/ls-esx 4 -local_disk: assigned: sys/chassis-1/blade-2: up SP: org-root/org-tory_org/ls-esx 4 -cluster-01 -node-01: assigned: sys/chassis-1/blade-6: up SP: org-root/org-tory_org/ls-esx 4 -cluster-01 -node-02: assigned: sys/chassis-1/blade-8: up Alternate UCS Query that pre filters ls. Server based on assign. State=assigned alleviates the need for [@assigned. State='assigned'] as part of the XPATH expression <config. Resolve. Class cookie="1251387546/3 b 3832 e 5 -d 066 -40 f 3 -a 3 b 1 -bb 65789 b 8 de 0" in. Hierarchical="true" class. Id="ls. Server"><in. Filter><eq class="ls. Server" property="assign. State" value="assigned" /></in. Filter> </config. Resolve. Class> Advanced Services © 2009 Cisco Systems, Inc. All rights reserved. Cisco Confidential 11

curl / xml Configuration Example Tools • curl – Command-Line URL • xml –

curl / xml Configuration Example Tools • curl – Command-Line URL • xml – XMLStarlet Methods • config. Conf. Mos Configurations • Manipulate UCS Objects Advanced Services © 2009 Cisco Systems, Inc. All rights reserved. Cisco Confidential 12

curl / xml Config Example – continued config. Conf. Mos – mgmt. Backup object

curl / xml Config Example – continued config. Conf. Mos – mgmt. Backup object <config. Conf. Mos in. Hierarchical="true" cookie="1251492362/1177 b 546 -1 da 1 -4 f 30 -8410 -6 bc 6 d 8 c 288 f 7"> <in. Configs> <pair key="sys/backup-10. 98. 47. 74"> <mgmt. Backup admin. State="enabled" descr="" dn="sys/backup-10. 98. 47. 74" hostname="10. 98. 47. 74" proto="tftp" pwd="" remote. File="ucs-bk 1 -172. 21. 60. 75 -config-system-2009 -08 -28" status="created" type="config-system" user="" /> </pair> </in. Configs> </config. Conf. Mos> <config. Conf. Mos cookie="1251492362/1177 b 546 -1 da 1 -4 f 30 -8410 -6 bc 6 d 8 c 288 f 7" response="yes"> <out. Configs> <pair key="sys/backup-10. 98. 47. 74"> <mgmt. Backup admin. State="enabled" child. Action="delete. Non. Present" descr="" dn="sys/backup 10. 98. 47. 74" fsm. Descr="" fsm. Prev="nop" fsm. Progr="100" fsm. Rmt. Inv. Err. Code="none" fsm. Rmt. Inv. Err. Descr="" fsm. Rmt. Inv. Rslt="" fsm. Stage. Descr="" fsm. Stamp="never" fsm. Status="backup. Begin" fsm. Try="0" hostname="10. 98. 47. 74" int. Id="157607" job="immediate" name="" post. Action="remove" proto="tftp" pwd="" remote. File="ucs-bk 1 -172. 21. 60. 75 -config-system-2009 -08 -28" status="created" type="config-system" user="" /> </pair> </out. Configs> </config. Conf. Mos> Advanced Services © 2009 Cisco Systems, Inc. All rights reserved. Cisco Confidential 13

curl / xml Config Example – continued config. Conf. Mos Advanced Services © 2009

curl / xml Config Example – continued config. Conf. Mos 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

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

Advanced Services © 2009 Cisco Systems, Inc. All rights reserved. Cisco Confidential 16