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 vSwitch or port group from the command line.

Resolution

To get/set the load balancing policy on a Virtual Switch on an ESXi Host

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

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

To set the load balancing policy of a 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 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

For more information on configuring a virtual switch from the command line, see Configuring vSwitch or vNetwork Distributed Switch from the command line in ESXi/ESX (1008127)