40

DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

Embed Size (px)

Citation preview

Page 1: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks
Page 2: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

UCS PowerTool Secrets - Tips and Tricks

John McDonough – Technical Marketing Engineer

DEVNET-1119

Page 3: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 3

• Introduction

• UCS XML API Overview

• UCS PowerTool Tips & Tricks

• Q & A

• Conclusion

Agenda

Page 4: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

Introduction

Page 5: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 5

Introduction – Session Information• Session: UCS PowerTool Secrets - Tips and Tricks

• Abstract: Find out how to fully utilize UCS PowerTool through it's extensive built-in object metadata and object relationship hierarchies. Learn about seldom used cmdlets that pack significant power and capabilities.

Page 6: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

What resources are available to get started

automating UCS Infrastructure?

Page 7: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 7

Cisco UCS User Community

• Web Based End User Community

• Tools, Downloads, Examples• UCS Platform Emulator (UCSPE)• XML API, PowerShell code Examples• Cisco UCS PowerTool (PowerShell Module)• Microsoft SCOM Management Pack for Cisco UCS / IMC• Microsoft SCVMM UI Extension for Cisco UCS• Microsoft SCO Integration Pack for Cisco UCS

• Documentation• Programming & Developer Guides• Whitepapers• Reference Guides (XML Model, Faults)

• Collaboration• Blogs• Peer to peer forums• Videos• Access to Cisco Subject Matter Experts

http://communities.cisco.com/ucs

Page 8: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 8

UCS Platform Emulator (UCSPE)

• No UCS Hardware Needed for API integration Development

• Full featured emulator for the UCS Manager• Installs as a Virtual Machine• Provides complete support for all XML API calls• Object Browser to peruse the UCSM model• Import & replicate existing live UCS Manager physical

inventory• Share saved physical inventories among UCS

Platform Emulators• Drag-n-drop hardware builder to create custom

physical inventory

http://communities.cisco.com/ucspe

Page 9: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

UCS XML API Overview

Page 10: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 10

Cisco Unified Computing System

Cisco UCS™ Manager

Cisco UCS Fabric Interconnects

Cisco UCS I/O modules

Cisco UCS Blade Server Chassis

Cisco UCS Blade and Rack Servers

Cisco UCS I/O Adapters

Page 11: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 11

UCS Manager Programmatic Infrastructure• Comprehensive XML API, standards-based interfaces

• Bi-Directional access to physical & logical internals

XML API

Direct UCS CLI UCS GUI 3rd Party Customer

Self Serve portals

Management Tools

Auditing Tools

System StatusPhysical InventoryLogical Inventory

Broad 3rd party integration supportFaster custom integration for customer use casesConsistent data and views across ALL interfaces

Page 12: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 12

UCS XML API Overview

UCS XML API Features

• Communicates over HTTP / HTTPS• XML Based, Transactional• Standard Request / Response cycle• Role Based Authentication• Object Model Hierarchy• Built-in Object Browser• Published XML Schema• Java Doc Style documentation• High Availability• Event Stream

XML API

Page 13: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 13

UCSM Object Model Documentation

Page 14: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

Management Information Model(MIM)

14

Everything is an object

Objects are hierarchically organized

Class identifies object type: Card, Port, VNIC…

Class InheritanceServer port is a subclass of port.A server blade is a subclass of compute entity.

Set of attributes

MO represents any physical or logical entity

UCS XML Database contains comprehensive system information Discovered components System configuration Operational status including statistics and faults

Managed Object

Root

Each MO is uniquely identified by DN

Page 15: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

Distinguished Names

15

Slash delimited sequence of RNs

RN identifies an object within the context of its parent object.

Immutable

dn = {rn1}/{rn2}/{rn3}

rn1

rn2

rn3

Example:

DN Provides a fully qualified path

Root

DN unambiguously identifies a target object. DN name is composed of sequence of Relative Names (RN).

<dn = "sys/chassis-5/blade-2/adaptor-1/host-eth-2"/> is composed of the following relative names:topSystem MO: rn="sys"equipmentChassis MO: rn="chassis-<id>"computeBlade MO: rn ="blade-<slotId>"adaptorUnit MO: rn="adaptor-<id>"adaptorHostEthIf MO: rn="host-eth-<id>"

Page 16: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

UCS PowerTool Tips & Tricks

Page 17: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 17

UCS XMLSchema

Processor

UCSM-IN.xsd

UCSM-OUT.xsd

AugmentSchema

XML Method & MO Meta Information

PowerShell Generator

Microsoft SCO IP Generator

XYZ Generator

Cisco UCSPowerTool

(1850+ cmdlets)

Microsoft SCO Integration Pack

XYZIntegration Pack

Cisco UCS PowerTool Automated Code Creation Automated Activity Generation from UCS XML Schema

Page 18: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 18

Cisco UCS PowerTool for UCS Manager• Chassis

• Hardware – Power Supply / Fan Modules / IO Modules

• Environmental statistical data (Power, cooling, network)

• Config and Hardware Faults

• Fabric Interconnect• Hardware – Power Supply / Fan

Modules / Network Expansion Modules

• Power / cooling / network/ environmental statistical data

• Network Elements (VLAN, VSAN, QoS, Port Profiles)

• Config and Hardware Faults

• Config. Operations• Pools (WWN, UUID, MAC, IP)• Policy creation, manipulation,

deletion, and consumption• vNIC / vHBA Templates• Service profile template

creation, cloning, deletion, and consumption• Simplistic service profile

creation (with a limited scope of what is available to configure)

• Expert SP creation (use variabilized XML w/ config file)

• Compare Managed Objects across orgs and/or domains

• Sync Managed Objects across orgs and/or domains

• Service Profiles• Policies (Firmware, Boot Order,

vNIC / vHBA config, Storage, IPMI, SoL, BIOS)

• Pools (WWN, UUID, MAC, IP)• Configuration Faults• Launch UCS KVM for SP

• Servers• Hardware - CPU, Memory,

Adaptors, CIMC• Power Operations• Power / cooling / network

/environmental statistical data• Hardware Faults

Page 19: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

Cisco UCS PowerTool – Get-Help

19

• Get-Help Add-UcsOrg

Page 20: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 20

Getting Started: UCS Connections• Connect-Ucs returns a UcsHandle on a successful connection

• Connect to 1 UCS, by Name/IP• Connect to ‘n’ UCS, by Name/IP, with the same credentials• Connect to ‘n’ UCS with information from a file, protected by a key

• If -NotDefault isn`t specified, handles go to a Default UcsHandle list

• By default, not more than 1 UcsHandle is allowed in the Default UcsHandle list• Override with: Set-UcsPowerToolConfiguration -SupportMultipleDefaultUcs $true

• Refresh of the connection happens in the background

• Get-UcsPSSession to see the Default UcsHandle list

• Export-UcsPSSession to save a set of UcsHandles to file

Page 21: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

Cisco UCS PowerTool – Get-UcsCmdletMeta

21

• Get-UcsCmdletMeta -ClassId OrgOrg or -Noun UcsOrg

Page 22: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

<fabricVlan childAction="deleteNonPresent" cloud="ethlan” compressionType="included" configIssues="" defaultNet="no” dn="fabric/lan/net-VLAN10-Mgmt" epDn="" fltAggr="0" global="0” id="10" ifRole="network" ifType="virtual" local="0" locale="external” mcastPolicyName="" name="VLAN10-Mgmt” operMcastPolicyName="org-root/mc-policy-default” operState="ok" peerDn="" policyOwner="local" pubNwDn=”” pubNwId="0" pubNwName="" sharing="none" switchId="dual" transport="ether" type="lan”/>

UCS Manager GUI – How to find the classId

Page 23: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

Cisco UCS PowerTool – Get-UcsCmdletMeta

23

• Get-UcsCmdletMeta –ClassId fabricVlan -Tree

Page 24: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 24

Transactions in UCS PowerTool for UCS Manager• A set of XML requests can be sent to UCS in a single transaction. • Only Add-* or Set-* cmdlets can be used in a transaction• Example of requests without transaction

• Get-UcsServiceProfile Server1 | Set-UcsServiceProfile -Descr Description1• <configConfMos cookie="" inHierarchical="false"><inConfigs><pair key="org-root/ls-Server1"><lsServer

descr="Description1" dn="org-root/ls-Server1" status="modified" /></pair></inConfigs></configConfMos>

• Get-UcsServiceProfile Server2 | Set-UcsServiceProfile -Descr Description2• <configConfMos cookie="" inHierarchical="false"><inConfigs><pair key="org-root/ls-Server2"><lsServer

descr="Description2" dn="org-root/ls-Server2" status="modified" /></pair></inConfigs></configConfMos>

• Example of same requests within transaction• $sp1 = Get-UcsServiceProfile Server1• $sp2 = Get-UcsServiceProfile Server2• Start-UcsTransaction• $sp1 | Set-UcsServiceProfile -Descr Description1 -Force• $sp2 | Set-UcsServiceProfile -Descr Description2 –Force• Complete-UcsTransaction –Xml

• <configConfMos cookie="" inHierarchical="false"><inConfigs><pair key="org-root/ls-Server1"><lsServer descr="Description1" dn="org-root/ls-Server1" status="modified" /></pair><pair key="org-root/ls-Server2"><lsServer descr="Description2" dn="org-root/ls-Server2" status="modified" /></pair></inConfigs></configConfMos>

• Pending transactions can be undone using Undo-UcsTransaction

•  

Page 25: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

ConvertTo-UcsCmdlet

25

Record UCS Manager activity Converts it into Windows

PowerShell Cmdlets

• Launch PowerTool

• Launch UCS Manager

• Run ConvertTo-UcsCmdlet

• Create VLAN in UCSM

• Capture the command and create automation script

Sample steps:

Page 26: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

UcsCmdlet -Xml Flag

26

• See the RAW XML Request and Response

Page 27: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

ConvertTo-UcsCmdlet -Python Flag

27

Record UCS Manager activity Converts it into UCS Python

SDK

• Launch PowerTool

• Launch UCS Manager

• Run ConvertTo-UcsCmdlet

• Create VLAN in UCSM

• Capture the command and create Python script

Sample steps:

Page 28: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 28

UCS PowerTool Parameter Validations• PowerShell has native support for parameter validation.

• PowerTool uses this feature to ensure parameter validations before sending XML requests.

• A validation in PowerTool generally falls in one or more of the categories below:• Length: minimum and maximum length of a string• Range: minimum and maximum value of an integral type• Value set: set of all possible values for a parameter• Pattern: regular expression based validation• Hybrid: A combination of the above.

Page 29: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 29

UCS PowerTool Parallelism

• When connected to multiple UCS, any request is sent to all systems in parallel.

Connected to Multiple UCS Domains

Get-UcsChassisGet-UcsChassis ParallelNot Parallel

Page 30: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 30

UCS PowerTool ParallelismConnected to Multiple UCS Domains

Page 31: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 31

Managed Object (MO) Versioning• MO Versioning Information is

required to be able to inter-operate between versions of UCS

• Assuming a MO with Properties A,B,C,D

• Field A• Field B• Field C• Field D

Version 1

Page 32: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 32

Managed Object (MO) Versioning• MO Versioning Information is required to

be able to inter-operate between versions of UCS Schema

• Assuming a field E which was not present in version 1 and was added in version 2.

• Compare-UcsMo method will skip this field while doing a MO comparison

• Sync-UcsMo will also skip this field while sending the diff to Version 1 UCS

• As a generic rule, Sync-UcsMo will skip operational properties, unknown properties and operational MOs, unknown MOs

• Field A• Field B• Field C• Field D

Version 1

• Field A• Field B• Field C• Field D• Field E

Version 2

Page 33: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 33

Compare & Sync Managed Objects (MO)• Compare-UcsManagedObject & Sync-UcsManagedObject work on a set of MOs, in a

generic manner.

• The usage scenarios are many .. esp. when considered with -XlateOrg, - XlateMap, -DeleteNotPresent

• The snippet below shows an unassociated SP from one org to another without losing any identifiers, etc. (done in 2 back to back transactions).

Page 34: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

Q & A

Page 35: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

Conclusion

Page 36: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 36

Participate in the “My Favorite Speaker” Contest

• Promote your favorite speaker through Twitter and you could win $200 of Cisco Press products (@CiscoPress)

• Send a tweet and include • Your favorite speaker’s Twitter handle @johnamcdonough• Two hashtags: #CLUS #MyFavoriteSpeaker

• You can submit an entry for more than one of your “favorite” speakers

• Don’t forget to follow @CiscoLive and @CiscoPress

• View the official rules at http://bit.ly/CLUSwin

Promote Your Favorite Speaker and You Could Be a Winner

Page 37: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119

Complete Your Online Session Evaluation

Don’t forget: Cisco Live sessions will be available for viewing on-demand after the event at CiscoLive.com/Online

• Give us your feedback to be entered into a Daily Survey Drawing. A daily winner will receive a $750 Amazon gift card.

• Complete your session surveys though the Cisco Live mobile app or your computer on Cisco Live Connect.

37

Page 38: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 38

Continue Your Education• Demos in the Cisco campus

• Walk-in Self-Paced Labs

• Table Topics

• Meet the Engineer 1:1 meetings

• Related sessions

Page 39: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks

Thank you

© 2015 Cisco and/or its affiliates. All rights reserved. Cisco PublicDEVNET 1119 39

Page 40: DEVNET-1119UCS PowerTool Secrets - Tips and Tricks