Quantcast
Channel: VMware Communities : Discussion List - Automation Tools
Viewing all articles
Browse latest Browse all 9071

Modifying script to automate Standard vSwitch VM Port Group setting creation ?

$
0
0

People,

 

I'm deploying multiple ESXi servers which needs to have access to lots of VLAN, hence I need to create about 10-15 VLANs as VM Port Group (Network Label) in one single ESXi host and as standard vSwitch.

This ESXi hosts does not have the capability of Distributed Switch, hence I must manually create the VLAN/Netowrk label one by one in standard vSwitch, and then move on to another ESXi hosts in all of the racks in the data center.

 

So I wonder if anyone here please can assist me in how to modify the script below to automate the VLAN creation in vSwitch2 from VLAN 1 up to 20 ?

 

Get-VirtualSwitch -Name vSwitch2 -VMHost PRODESXi01 |

   New-VirtualPortgroup -Name "Company_Network_VLAN $($_.VLAN)" -VLANID $($_.VLAN)

 

Existing:

Name of the vSwitch: vSwitch2

VM Port Group Label: Company_Network_VLAN1

VLAN ID: 1

 

VM Port Group Label: Company_Network_VLAN2

VLAN ID: 2

....

....

VM Port Group Label: Company_Network_VLAN20

VLAN ID: 20

 

Thanks in advance.


Viewing all articles
Browse latest Browse all 9071

Trending Articles