UCS Powertool scripts are handy, when you find yourself in situations where a project requires you to add 500+ VLANS to UCSM. When the task is time consuming you should find a way to automate it. If your scripting skills isn’t up to scratch, you need to weigh up the time to script vs manually performing the task. Hopefully, the Powershell script examples at bottom of this page may have turnkey script that could be a use to you.
Cisco developed UCS Powertool to automate UCS tasks using Powershell cmdlets. You can Download Powertool software and install it on the computer / server you have access to UCSM from. Once the executable has been installed, follow the simple steps below.
Connect to a UCSM cluster IP (or emulator) by typing “Connect-Ucs <UCSM-IP address> or <hostname>” command. Enter the UCSM login details when prompted.
After successful login, execute the cmdlet “Start-UcsGuiSession -LogAllXml” in Powertool to kick off the UCSM GUI.
Once GUI has launched, type “ConvertTo-UcsCmdlet” in the PowerTool window prompt.
To get the commands for an action within UCSM, perform the steps as you would want within UCS GUI. e.g. Create a VLAN or Add a VLAN to vNIC template. If you are familiar with Excel Micros then this step would be something similar.
After few seconds, UCS Powertool will spit out the cmdlets for the action you just performed in UCSM GUI.
If you have a long list of VLANS to add then best to stick it in an Excel spreadsheet and do what I did below and then save full commands as filename.ps1:
In some cases, where you already have bunch of VLANs within UCS and you wish to add some of it to VLAN Groups, then it’s easier to export the names to a CSV from the screen below and do what I did with Excel above to concatenate.
You can check the operational status of the cluster and Fabric Interconnects using “Get-ucsfimodule ¦ select descr,operstate“.
UCS Powertool scripts example
Download instruction at end of this table!
Power OFF unassociated UCS Blades
This script will enable you to power down un-associated blades by creating temporary service profiles. You’ll be surprised how much power you can save in a large server estate if you have unused UCS blades.
UCS AD Authentication Integration
Powershell script to automate LDAP / Active Directory integration of UCSM.
UCS Inventory Tool
Populates spreadsheet with extracted hardware information from UCS as an inventory.
Quick Launch UCSM GUI PowerShell Script
Connect to UCSM GUI without asking for login prompt. This creates a secure credential file so it bypasses default login process.
Multi-Domain UCS Backup Script
Login multiple UCS domains and take all 4 types of back ups.
Set User Labels for Servers
Create user labels for rack and blade servers for better inventory.
UCS WWPN Collector Script
Powershell script to output WWPN and vHBA details for each service profiles. Usually handy if you need to pass this information to SAN administrator for Zoning.
UCS Serial Number Export Script
Useful tool to if you need all the serial numbers to register with SmartNet.
Generate SAN Zones for Brocade or MDS
Collect Aliases, Zones and Zone Sets for Cisco MDS/Nexus or Brocade.
Checks the current bandwidth of all adapters
Displays details of bandwidth on all the vNIC adapters.