Twice in one week, I had customers ask me "How can I quickly add lots of blocks to global pools without having to point-and-click forever through the GUI?"
"Easy!", I responded. Because now we have a beta-version of UCS PowerTool for UCS Central, which gives administrators the ability to script operations to UCS Central much in the same way they've done using Cisco UCS PowerTool for UCS Manager.
The script attached here doesn't actually run PowerTool commands, but instead it generates the PowerTool commands that you would need to quickly populate pools with blocks. You can then copy/paste the output in to a PowerTool session that you've already established.
Among the assumptions here:
- Block sizes are 256 (0xFF)
- The Global ID Pool already exists (but is not populated)
Users should carefully review the generated output before actually submitting to PowerTool
Sample output will have the following format
$POOL = Get-UcsCentralWwnPool -name G-WWPN-A
Start-UcsCentralTransaction
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:A0:00:00 -To 20:00:00:25:B5:A0:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:A1:00:00 -To 20:00:00:25:B5:A1:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:A2:00:00 -To 20:00:00:25:B5:A2:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:A3:00:00 -To 20:00:00:25:B5:A3:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:A4:00:00 -To 20:00:00:25:B5:A4:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:A5:00:00 -To 20:00:00:25:B5:A5:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:A6:00:00 -To 20:00:00:25:B5:A6:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:A7:00:00 -To 20:00:00:25:B5:A7:00:FF
Complete-UcsCentralTransaction
The script will prompt interactively for the parameters it needs. Or you can supply everything on the command line, such as:
PS C:\Users\jesilber\Desktop> .\Ucs_Central_Pool_Pop.ps1 -PoolName G-WWNN-MyDefault -Type WWN -NumBlocks 64 -Uniq F
$POOL = Get-UcsCentralWwnPool -name G-WWNN-MyDefault
Start-UcsCentralTransaction
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:F0:00:00 -To 20:00:00:25:B5:F0:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:F1:00:00 -To 20:00:00:25:B5:F1:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:F2:00:00 -To 20:00:00:25:B5:F2:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:F3:00:00 -To 20:00:00:25:B5:F3:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:F4:00:00 -To 20:00:00:25:B5:F4:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:F5:00:00 -To 20:00:00:25:B5:F5:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:F6:00:00 -To 20:00:00:25:B5:F6:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:F7:00:00 -To 20:00:00:25:B5:F7:00:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:F8:00:00 -To 20:00:00:25:B5:F8:00:FF
[...]
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:FF:3D:00 -To 20:00:00:25:B5:FF:3D:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:FF:3E:00 -To 20:00:00:25:B5:FF:3E:FF
$POOL | Add-UcsCentralWwnMemberBlock -From 20:00:00:25:B5:FF:3F:00 -To 20:00:00:25:B5:FF:3F:FF
Complete-UcsCentralTransaction