davidstamen 09月29日 10:50
PowerCLI脚本批量添加VLAN至UCS配置
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文介绍了一款PowerCLI脚本,用于批量添加VLAN至Cisco UCS配置,解决UCS不支持批量添加VLAN的问题,提高配置效率。

We are currently working on some Cisco ACI Integration and wanted to add a large VLAN Pool to a UCS Configuration.

Since currently Cisco UCS does not allow selecting multiple VLAN’s easily when adding to a VLAN Group or vNIC Template, we now have a pretty decent script that will do it for you.

The script can be found here.

 1# PowerCLI Script for adding VLAN to VLAN Group and vNIC Template 2# @davidstamen 3# http://davidstamen.com 4 5#Define Variables 6$cred = Get-Credential 7$ucs = "ucs01" 8$startvlan = "100" 9$endvlan = "150"10$vnictemplate = "vnic-template"11$vlangroup = "vlan-group"1213#Connect to UCS14Connect-UCS $ucs -credential $cred1516#Assumes VLAN Name is the VLANID. Adds VLAN from start to end to vlan group17for($i=$startvlan;$i -le $endvlan;$i++){Get-UcsFabricNetGroup -Name $vlangroup |Add-UcsFabricPooledVlan -Name "$i"}1819#Assumes VLAN Name is the VLANID. Adds VLAN from start to end to vnic template20for($i=$startvlan;$i -le $endvlan;$i++){Get-UcsVnicTemplate -Name $vnictemplate | Add-UcsVnicInterface -ModifyPresent -DefaultNet false -Name "$i"}21Disconnect-UCS

You now are done! In my case I had to add 500 VLAN’s, so this script saved me quite a bit of time.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

PowerCLI VLAN UCS 批量添加 脚本
相关文章