Specifying or changing the load balancing policy from the command line in ESXi
search cancel

Specifying or changing the load balancing policy from the command line in ESXi

book

Article ID: 302391

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article outlines how to specify the load balancing policy on a Standard vSwitch or port group from the command line.

Environment

VMware vSphere ESXi 7.x
VMware vSphere ESXi 8.x

Resolution

To get/set the load balancing policy on a Standard vSwitch on an ESXi Host

To list the current NIC teaming policy of a Standard vSwitch, use the command below, replacing vSwitch_name with the name of your Standard vSwitch, e.g. vSwitch0:

  • esxcli network vswitch standard policy failover get -v <vSwitch_name>

To set the load balancing policy of a Standard vSwitch, use this command:

  • esxcli network vswitch standard policy failover set -l <policy> -v <vSwitch_name>

Note: available policy options:

  • explicit = Use explicit failover order

  • portid = Route based upon port id (this is the default setting)

  • mac = Source based upon MAC hash

  • iphash = Source based up IP hash (this is only to be used in a etherchannel/Portchannel)

For example, to set the load balancing policy of a Standard vSwitch named vSwitch0 to IP hash:

  • esxcli network vswitch standard policy failover set -l iphash -v vSwitch0

 

To get/set the load balancing policy on a Port Group on an ESXi Host

To list the current load balancing policy of a port group, run this command with (use your own specified port group name):

  • esxcli network vswitch standard portgroup policy failover get -p <portgroup_name>

To set the load balancing policy of a port group, run this command (with your desired policy from the list above):

  • esxcli network vswitch standard portgroup policy failover set -p <portgroup_name> -l <policy>

For example, to set the load balancing policy of a portgroup named "Management Network" to IP hash:

  • esxcli network vswitch standard portgroup policy failover set -p "Management Network" -l iphash

Additional Information