I had a discussion with one of my readers last week and just read this post on the VMTN community which triggered this article.
When you create a highly available environment take into account that you will need to have enough vSwitch ports available when a failover needs to occur. By default a vSwitch will be created with 56 ports and in general this is sufficient for most environments. However when two of your hosts fail in a 10 host cluster you might end up with 60 or more VMs running on a single host. If this would happen several VMs would not have a vSwitch port assigned.
The most commonly used command when creating an automated build procedure probably is:
esxcfg-vswitch -a vSwitch1
This would result in a vSwitch named “vSwitch1” with the default amount of 56 ports. Now it is just as easy to set it up with 128 ports for instance:
esxcfg-vswitch -a vSwitch1:128
Always design for a worst case scenario. Also be aware of the overhead, some ports are reserved for internal usage. You might want to factor in some additional ports for this reason as for instance in the example above you will have 120 ports available for your VMs and not the 128 you specified.
afokkema says
Or you can use the following command:
/usr/bin/vmware-vim-cmd hostsvc/net/vswitch_setnumports vSwitch1 128
if you want to use vmware-vim-cmd 😉
Bouke Groenescheij says
I just don’t get why VMware still defaults it to 56? These days virtualisation ratios are getting higher and higher. The thing what I’m also missing is the impact of choosing a higher amount of ports other than than the total amount of configurable switches. Is a 56 port switch faster then a 120 one? Why not just configure 2040 or 4088 ports???
Jason Boche says
Another hidden gotcha here is that changing the number of ports on a vSwitch after it is created requires a host reboot which will then put the cluster at N-2.
Cascading impacts – DOH!
Duncan Epping says
@Bouke you could do that if you are sure you will keep the same amount of vSwitches. As you know a host is “limited” in the amount of vSwitch / vDS ports it can have… But I agree. You could easily use a higher number without causing any issues. It is not going to be slower etc.
PiroNet says
Hi Duncan, don’t you have any sort of buffer(s) attached to the vSwitch that you may need to increase if you add more ports to it?