UCS CONVERTTO-UCSCMDLET PROCEDURE:
- Load Cisco UCS Manager PowerTool.
- 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.
UCSM VLAN Export CSV
Some other common cmdlets in UCS Powertool are:
- Get-Ucsblade
- Get-UcsServiceProfile
- Connect-UcsServiceProfile -ServiceProfile ServiceProfileName -Blade ServerID
- Full reference list of Reference guide for Powertool can be found here for version 1.x.
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!
1 | 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. |
2 | UCS AD Authentication Integration | Powershell script to automate LDAP / Active Directory integration of UCSM. |
3 | UCS Inventory Tool | Populates spreadsheet with extracted hardware information from UCS as an inventory. |
4 | 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. |
5 | Multi-Domain UCS Backup Script | Login multiple UCS domains and take all 4 types of back ups. |
6 | Set User Labels for Servers | Create user labels for rack and blade servers for better inventory. |
7 | 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. |
8 | UCS Serial Number Export Script | Useful tool to if you need all the serial numbers to register with SmartNet. |
9 | Generate SAN Zones for Brocade or MDS | Collect Aliases, Zones and Zone Sets for Cisco MDS/Nexus or Brocade. |
10 | Checks the current bandwidth of all adapters | Displays details of bandwidth on all the vNIC adapters. |
Download these and more powershell scripts | Powershell script samples |
Let us know if you are trying to script a task using this tool.
No comments:
Post a Comment