Cisco UCS PowerTool
An introduction to PowerShell automation for Cisco UCS
Joe Martin
Consulting Systems Engineer, CCIE #5917
TechEd 2014
Agenda

UCSM…What is it?

What is PowerTool

Where to download

How to download

How to install

How to learn to use

Sample and example scripts

Q&A – Along the way (Don’t be shy!)
© 2013-2014 Cisco and/or its affiliates. All rights reserved.
Link to slides
at end of
presentation
Cisco Confidential
3
UCSM = Programmatic Infrastructure = SDC
(Software Defined Compute)
 UCS Manager is an API not a GUI or CLI…but it has those
 Comprehensive XML API, standards-based interfaces
 Bi-Directional access to physical & logical internals
System CenterSCOM/VMM/Orch
PowerShell
Direct
UCS CLI
UCS GUI
3rd Party
CustomSelf Serve portals
Management Tools
Auditing Tools
Customer
XML API
System Status
Physical Inventory
Logical Inventory
© 2013-2014 Cisco and/or its affiliates. All rights reserved.
Cisco Confidential
4
What is PowerTool
PowerShell modules for Cisco UCS Servers
Available for UCS managed systems and stand-alone C-Series
PowerTool for UCSM is automatically generated by our XML schema
Free to download from http://cisco.com
PowerTool for UCSM contains 1866 cmdlets
Can do 100% of UCSM with PowerTool
Follows Microsoft best practices
Easy to learn how to use…I promise!
© 2013-2014 Cisco and/or its affiliates. All rights reserved.
Cisco Confidential
5
Depth of PowerTool Capabilities

Hardware


Pools


BIOS, Firmware, Adapters, Boot, Drives, etc.
Templates


Servers, UUID, MAC, IP, WWPN, WWNN, iSCSI, etc.
Policies


VLANs, LAN Uplink, SAN Uplink, Server, Appliance Ports, Port Channels, etc.
vNIC, vHBA, Service Profile Templates, etc.
Reporting

vNIC Statistics, vHBA Statistics, Thermal, Resources, etc.
© 2013-2014 Cisco and/or its affiliates. All rights reserved.
Cisco Confidential
6
Downloading

Go to http://www.cisco.com

Log in using your CCO credentials

If you don’t have credentials it’s easy to register

Select ‘Support’ then ‘All Downloads’

In Find type: PowerTool and select ‘Cisco UCS Management Partner
Ecosystem Software’

Click on ‘Unified Computing System (UCS) PowerTool’

Select ‘Cisco IMC PowerTool pack for Powershell’ for Stand-Alone C-Series
or ‘Cisco PowerTool pack for Powershell’ for UCSM

Select ‘Download’
© 2013-2014 Cisco and/or its affiliates. All rights reserved.
Cisco Confidential
7
Installing PowerTool

Launch installer

Next>

Accept license agreement, Next>

Install Location, Next>

Install

Accept UAC

Finish
© 2013-2014 Cisco and/or its affiliates. All rights reserved.
Cisco Confidential
8
Using PowerTool

Import-Module CiscoUcsPs


Get-Command -Module CiscoUcsPs | Out-File .\CiscoUcsPs_Cmdlets.txt


List of cmdlets
Get-Command -Module CiscoUcsPs | Measure-Object


Load module
How many cmdlets
Get-Help <verb-UCScmdlet> -full
© 2013-2014 Cisco and/or its affiliates. All rights reserved.
Cisco Confidential
9
Easy to Learn

Open UCSM GUI

Import-Module CiscoUcsPs

Enter ConvertTo-UcsCmdlet in a PowerShell session

This cmdlet will run forever till stopped

Do something in the UCSM GUI and hit ‘Save’

Watch your PowerShell session now


Demo
First time is a bit slow to produce output…be patient
Will see the PowerShell for that UCSM configuration
© 2013-2014 Cisco and/or its affiliates. All rights reserved.
Cisco Confidential
10
Logging into UCSM

Log into a UCSM domain
$cred = Get-Credential
$myucs = read-host “Enter UCSM Hostname or IP”
$mycon = Connect-Ucs -Name $myucs -Credential $cred
#do your thing
Disconnect-Ucs
Log into multiple UCSM domains
$multilogin = Set-UcsPowerToolConfiguration -SupportMultipleDefaultUcs $true
$cred = Get-Credential
$myucs = @("192.168.2.10","10.20.31.6")
$mycon = Connect-Ucs -Name $myucs -Credential $cred
#do your thing
Disconnect-Ucs
© 2013-2014 Cisco and/or its affiliates. All rights reserved.
Cisco Confidential
11
Bringing it Together

From our learning on ConvertTo-UcsCmdlet we got


Get-UcsLanCloud | Add-UcsVlan -CompressionType "included" DefaultNet "no" -Id 99 -McastPolicyName "" -Name "test" PubNwName "" -Sharing "none" -XtraProperty @{PolicyOwner="local"; }
Strip down to what we need


Demo
Get-UcsLanCloud | Add-UcsVlan -Id 99 -Name "test“
Script it
$VLANList = Import-Csv “.\VLANList.csv“
 foreach ($item in $VLANList)
 {Get-UcsLanCloud | Add-UcsVlan -Id $item.VLAN -Name $item.Name}

© 2013-2014 Cisco and/or its affiliates. All rights reserved.
Cisco Confidential
12
Demos

Demo
Build a complete UCS in just a few minutes
Answer file based = repeatable, consistent
 Configures 100% of UCS


Zone your SAN in minutes
Build 5120 zones with aliases across 2 MDS fabrics in 42 minutes
 Writes 5120 zones with aliases to file in under 1 minute


Rename your Windows NICs in seconds

Renames physical vNICs and Hyper-V vSwitches
© 2013-2014 Cisco and/or its affiliates. All rights reserved.
Cisco Confidential
13
Resources

PowerTool Documentation


Forums


http://www.cisco.com/c/en/us/td/docs/unified_computing/ucs/sw/msft_to
ols/C-Series/powertools/ucs_powertool_book/ucs_pwrtool_bkl1.pdf
https://communities.cisco.com/community/technology/datacenter/ucs_ma
nagement/cisco_ucs_developed_integrations
My Script Repository / This slide deck

https://communities.cisco.com/people/joemar/content
© 2013-2014 Cisco and/or its affiliates. All rights reserved.
Cisco Confidential
14
Slides and Scripts:
https://communities.cisco.com
/people/joemar/content
Thank you.
Joe Martin
Consulting Systems Engineer, CCIE #5917
Cisco Systems
Tel: 425-468-1015
Email: joemar@cisco.com