VMware Cloud Community
chouse
Enthusiast
Enthusiast

Using vicfg-vswitch to add a new virtual switch with a specific number of ports?

In the ESX 3.5 days, I could use esxcfg-vswtich -a vSwitch1:120 to create vSwitch1 with 120 ports. I can't find a way to do that using the vCLI on a Windows host against ESXi 4u1 with vicfg-vswitch -a. If I use the same format and do vicfg-vswitch -a vSwitch1:120, I end up with a vSwitch named "vSwitch1:120". Lame.

Message was edited by: chouse

Reply
0 Kudos
7 Replies
AntonVZhbankov
Immortal
Immortal

ESX 4.0u1

>root@esx2 ~# esxcfg-vswitch -a vSwitch1:120

>root@esx2 ~# esxcfg-vswitch -l

>Switch Name Num Ports Used Ports Configured Ports MTU Uplinks

>vSwitch1 128 1 120 1500

PortGroup Name VLAN ID Used Ports Uplinks


---

MCSA, MCTS, VCP, VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, HPE ASE, MCITP: SA+VA, VCP 3/4/5, VMware vExpert XO (14 stars)
VMUG Russia Leader
http://t.me/beerpanda
chouse
Enthusiast
Enthusiast

Sorry, I'm using vCLI on windows against an ESXi 4u1 host.

Reply
0 Kudos
AntonVZhbankov
Immortal
Immortal

According to page 37 of vSphere Command-Line Interface Installation and Reference Guide there is no such option to set number of ports.

So it works fine, you just have to reconfigure your vSwitch manually in vSphere Client to change number of ports.


---

MCSA, MCTS, VCP, VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, HPE ASE, MCITP: SA+VA, VCP 3/4/5, VMware vExpert XO (14 stars)
VMUG Russia Leader
http://t.me/beerpanda
chouse
Enthusiast
Enthusiast

Yep, that's what I expected, having not seen any such option in the documentation, nor in the perl source for the script. The downside is changing the number of ports after adding a switch requires a reboot.

Thanks.

Reply
0 Kudos
AntonVZhbankov
Immortal
Immortal

I suppose you won't change number of ports 5 times a day Smiley Happy


---

MCSA, MCTS, VCP, VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, HPE ASE, MCITP: SA+VA, VCP 3/4/5, VMware vExpert XO (14 stars)
VMUG Russia Leader
http://t.me/beerpanda
Reply
0 Kudos
lamw
Community Manager
Community Manager

This was pretty simple to just update the existing esxcfg-vswitch to also support adding number of ports when creating a new vSwitch.

Take a look at this modified script:

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

Reply
0 Kudos
brtlvrs
Enthusiast
Enthusiast

tnx.... the link to http://communities.vmware.com/docs/DOC-11800 a custom esxcfg-vswitch script was the answer for me to 'change' the amount of ports for a switch without rebooting the host.... (the best option would be to use vmotion and a SAN so you can move the vm's from the host.....)

I'll write my actions down and post it to this forum... next week

Please consider marking this answer "CORRECT" or "Helpful" if you think your question have been answered correctly.
Reply
0 Kudos