VMware Cloud Community
ArrowSIVAC
Enthusiast
Enthusiast

ESX 4 dvSwitch Script to Add port groups with VLAN tags

I use a script to build out an esx server once i complete the install.

this autmates the creation of the various port groups and corresponding VLANs. There are about 30 of them and I also use this set of scripts to "on-demand" provision and de-provision port groups for testing.

ESX 3.5 Example:

esxcfg-vswitch vSwitch0 -A 002ATCORELInfrastructure

esxcfg-vswitch vSwitch0 -p 002ATCORELInfrastructure -v 2

esxcfg-vswitch vSwitch0 -A 003ATLCOREPhysical

esxcfg-vswitch vSwitch0 -p 003ATLCOREPhysical -v 3

.....etc.....

New ESX 4 running on dvSwitch: give me the error:

# esxcfg-vswitch dvSwitch -A 002ATCORELInfrastructure

No such virtual switch: dvSwitch

# esxcfg-vswitch -l

DVS Name Num Ports Used Ports Configured Ports Uplinks

dvSwitch 256 5 256 vmnic0,vmnic1

DVPort ID In Use Client

9 1 vmnic1

10 1 vmnic0

11 0

12 0

102 1 vswif0

103 1 vmk0

Thoughts?

Reply
0 Kudos
3 Replies
Harish_Chilikot
Enthusiast
Enthusiast

you can not set the vlan or anything for vDS using esxcfg-vswitch command, these operations need to be done through VC.

Reply
0 Kudos
bulletprooffool
Champion
Champion

Due to the way in which dvswitches work . . there is generally not much vlaue in scripting the addition of port groups, as you only need to add each port group once with a dvSwitch and it applies to all hosts.

(unless you are of course add very large numbers of port groups)

One day I will virtualise myself . . .
Reply
0 Kudos
ArrowSIVAC
Enthusiast
Enthusiast

Does 70VLANs over six seperate VMWare cluster farms coordinated via script (due to vendor mix) of Brocade, HP Procurve, HP VC, Netgear and CISCO ethernet switches to coordinate VLAN configurations.

Ya... I would say it is of value.

Reply
0 Kudos