Setting the vSwitch load balance policy using command line on an ESX host
search cancel

Setting the vSwitch load balance policy using command line on an ESX host

book

Article ID: 308587

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article outlines steps for setting up the vSwitch load balance policy in an ESX 4.x/3.x host using the command line.


Symptoms:



Environment

VMware ESX Server 3.0.x
VMware ESX 4.1.x
VMware ESX Server 3.5.x
VMware ESX 4.0.x

Resolution

Note: Before you begin, see Restarting the Management agents on an ESX or ESXi Server (1003490) for important information on restarting the mgmt-vmware service.

In this example, the physical switch is set to use for instance ether channel and IP hash, set load balance policy using the command line interface.

  1. Check the current vSwitch settings, run the command:

    esxcfg-vswitch -l

  2. Check the current uplink, run the command:

    esxcfg-nics -l

  3. Add an uplink with the command:

    esxcfg-vswitch -L vmnic# vSwitch#

  4. Verify teamed uplinks with the command:

    esxcfg-vswitch -l

  5. Set load balancing policy. The options are:

    • Port ID = loadbalance_srcid
    • IP Hash = loadbalance_ip
    • MAC = loadbalance_srcmac
    • Failover Only = failover_explicit

      For example:

      vimsh -n -e "hostsvc/net/vSwitch_setpolicy --nicteaming-policy loadbalance_iphash vSwitch#"

  6. Refresh network settings with the command:

    vimsh -n -e "/internalsvc/refresh_network"

  7. Restart the management service with the command:

    service mgmt-vmware restart

  8. Ping the gateway to confirm connectivity:

    ping x.x.x.x


Additional Information

For ESXi, see Changing the load balancing policy in ESXi using Tech Support Mode (1011520).Restarting the Management agents in ESXi
Changing the load balancing policy in ESXi using Tech Support Mode