Change Active Adapters and Load Balancing using ESXi Shell

Anyone ever had a network administrator make your hosts lose connectivity and the only option you have is to use the ESXi shell through an HP ILO port? I have. Here are the changes that were helpful to me at the time.

freakout

esxcli network vswitch standard list — This lists all of the vswitches on the host.
listvswitch

esxcli network vswitch standard uplink add -u vmnic1 -v vSwitch0 — Add an uplink to the vswitch. Just switch “add” to “remove” to get rid of a vmnic from the vswitch.
adduplinktovswitch

esxcli network vswitch standard policy failover get -v vSwitch0 — Get the load balancing policy for the vSwitch.
getvswitchpolicy

esxcli network vswitch standard policy failover set -a vmnic1 -v vSwitch0 — Be careful because when changing the active vmnics on a vswitch it will only add ones that you specify and if there are active ones that you specify it will move them to unused.
Incorrect
setactivevmniconvswitchfail
Correctsetactivevmniconvswitch

esxcli network vswitch standard portgroup policy failover get -p “Management Network” — This shows the policy information for the portgroup “Management Network”
getportgrouppolicy

esxcli network vswitch standard portgroup policy failover set -a vmnic1 -p “Management Network” — Change the active adapter on the Management Network.
setactivevmniconportgroup

esxcli network vswitch standard policy failover set -l iphash -v vSwitch0 — Set the load balancing on the vSwitch0 to iphash. Please be aware that this might change the portgroups to iphash if they are set to get their settings from the vswitch.
setloadbalanceonvswitch

esxcli network vswitch standard portgroup policy failover set -l iphash -p “Management Network” — Sets the load balancing policy on the Management Network portgroup to iphash. This will cause the load balancing policy on the vswitch to no longer apply to the Management Network portgroup.
setloadbalanceonportgroup

Advertisements

2 responses to “Change Active Adapters and Load Balancing using ESXi Shell

  1. I have a challenge and after reading your topic above, I thought maybe you could help. I have a AMD ESX 5.5 U2 system and I needed to update the BIOS to support the 6300 Opteron I was installing. The system had been running fine for a year with 5 guests on it. However, after the BIOS update I could no longer connect to the mgmt IP. After investigation, it appears that a configuration change occurred, most probably erroneously, where the failover policy (teaming) now has the same NIC (vmnic1) as the active adapters. In other words, if you screen shot above that has Active Adapters vmnic0 and vmnic1, mine says vmnic1, vmnic1. This cant be right. So I want to remove/disable teaming. And every command I try fails. I’ve tried adding vmnic0, removing vmnic1. Changing policy from mac to iphash.. all get errors. help

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s