VMWare Load Balancing

Within VMWare there are a few choices to handle load balancing when you have multiple links attached to the host.

There’s essentially 3 choices with a standard vSwitch:
  • Route Based on IP Hash
  • Route Based on Source MAC Hash
  • Route Based on Originating port ID

With a fourth option, “Use Explicit Failover Order” which is not so much a load balancing method, but to define primary/fallback interfaces.

There’s also a fifth option when using a distributed switch (vds), “Route Based on Physical NIC Load”

MAC Hash and Originating Port ID are somewhat similar. VMWare determines an uplink to use either based on the VM’s port or a hash based on the VM’s MAC. Neither requires special configuration on the switch side.

IP Hash is more involved, but provides the best load balancing, as the switch calculates a hash using the source and destination IP addresses – allowing a single VM to leverage multiple NICs attached to the host.

However, the switch that connects to the VM host needs to be configured for a static port-channel (etherchannel) and unless there’s a technology in place to allow cross-switch port-channels, such as vPC/stacking/vss it may not be possible to provide switch-side redundancy… In this case, it is better to use the other load balancing options.

Configuration example for physical switch (Cisco IOS):

port-channel load-balance src-dst-ip

interface Gi1/0/1
description Uplink 1
channel-group 1 mode on
switchport trunk encapsulation dot1q
switchport mode trunk
switchport nonegotiate

interface Gi1/0/2
description Uplink 2
channel-group 1 mode on
switchport trunk encapsulation dot1q
switchport mode trunk
switchport nonegotiate

interface Po1
description Port-Channel for VMWare IP Hash Load Balancing
switchport trunk encapsulation dot1q
switchport mode trunk
switchport nonegotiate

The above assumes the host is connect to port Gi1/0/1 and Gi1/0/2. We’re using 802.1q trunking with a native VLAN of 1. (Switchport Nonegotiate turns off Dynamic Trunking Protocol.)

DavisSystem

Consolidated Notes From the Desk of Sean Davis.


Overview of VMWare Load Balancing

By Sean, 2022-01-20