VMware Cloud Community
cdu
Enthusiast
Enthusiast
Jump to solution

what command to change num of ports for vSwitch0?

I'm developing kickstart to deploy ESX4 U1 to upgrade our 100 ESX 3.5 servers. After trying for a day, I got almost everything working. The problem is vSwitch0 is created with only 32 ports. I can use vi client to change port num after, but it is nice to have everything set using kickstart.

Is there a command to change num of ports for vSwitch0? I know you can create a vSwitch with num of port for new vswitch, but not for vSwitch0 which is created during istallation.

For those using pxe boot and having issue with no cos nics added by user, it is not a real error message, press Alt + F1 to see the real error message, it should tell you what the problem is.

Thanks

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
BenConrad
Expert
Expert
Jump to solution

I do this in my postconfig:

perl -pi -w -e 's/\/net\/vswitch\/child\[0000\]\/numPorts = \"\d+\"/\/net\/vswitch\/child\[0000\]\/numPorts = \"256\"/g;' /etc/vmware/esx.conf

Ben

View solution in original post

0 Kudos
8 Replies
lamw
Community Manager
Community Manager
Jump to solution

esxcfg-vswitch -a <vswitchname>:numports

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

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 Community

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

cdu
Enthusiast
Enthusiast
Jump to solution

Thanks for the quick reply.

vSwitch0 is created automatically during kickstart with 32 ports and I can't recreate it at postscript. The command can be used to create vSwitch1, etc.

Is there any solution to that?

Thanks

0 Kudos
Troy_Clavell
Immortal
Immortal
Jump to solution

can I ask why you need more than the supplied default? Typically you'll just have the COS and VMkernel ports on vSwitch0. Is it a limitation you have with pNICs?

0 Kudos
cdu
Enthusiast
Enthusiast
Jump to solution

Yes, these are all blades and each of them only has 2 pnics. There is nothing I can do until hardware refresh end of next year.

0 Kudos
BenConrad
Expert
Expert
Jump to solution

I do this in my postconfig:

perl -pi -w -e 's/\/net\/vswitch\/child\[0000\]\/numPorts = \"\d+\"/\/net\/vswitch\/child\[0000\]\/numPorts = \"256\"/g;' /etc/vmware/esx.conf

Ben

0 Kudos
cdu
Enthusiast
Enthusiast
Jump to solution

Thanks for the idea. Works like a charm.

0 Kudos
cdu
Enthusiast
Enthusiast
Jump to solution

Found the command to do it instead of modifying conf file.

vmware-vim-cmd hostsvc/net/vswitch_setnumports vSwitch0 64

0 Kudos
BenConrad
Expert
Expert
Jump to solution

I believe that command relies on hostd to be running, so you need to put a loop in there to check for a running hostd.

Ben