Pages

Thursday, December 1, 2011

Modifying load balancing policy for a vSwitch on ESXi 5.0

It’s been such a busy 2 months for me over here that I just realized I’ve written 5 posts in October 2011 and 3 posts in November 2011.  My draft items in my Outlook which I use to keep notes for blog posts is now at 102 items!  December looks to be another busy month but I’ve made a promise to myself that I’ll dedicate some time over the following weeks to catch up on my blogs.  Now that I’ve made my rant, let’s get on with the reason why I’m writing this post and the usual solution to my problem.

I’m currently working on a project for a hosting company to upgrade their vSphere 4 ESXi 4.1 hosts to vSphere 5 ESXi 5.0 and instead of performing an in-place upgrade, we decided to just do overwriting fresh installs on each host one after another.  The challenge I ran into was that these blades has all traffic (management, VMotion, VM traffic, etc) traversing through 1 x Intel X520-T2 with 2 x 10Gbps ports.  Since the switches have already been configured with port-channeling, the server did not have network connectivity after the fresh install of ESXi 5.0.  This set me on a search for the commands to modify the default vSwitch 0 load balancing policy to Route based on IP Hash

While the search did not take long and the information was available through VMware KB articles, I thought I’d write this post to include the commands so I can reference it in the future:

Command to modify vSwitch 0 to Route based on the originating virtual switch port ID

vim-cmd /hostsvc/net/vswitch_setpolicy --nicteaming-policy='loadbalance_srcid' vSwitch0

Command to modify vSwitch 0 to Route based on source MAC hash

vim-cmd /hostsvc/net/vswitch_setpolicy --nicteaming-policy='loadbalance_srcmac' vSwitch0

Command to modify vSwitch 0 to Route based on IP hash

vim-cmd /hostsvc/net/vswitch_setpolicy --nicteaming-policy='loadbalance_ip' vSwitch0

Command to modify vSwitch 0 to Use explicit failover order

vim-cmd /hostsvc/net/vswitch_setpolicy --nicteaming-policy='failover_explicit' vSwitch0

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

Reference VMware KB Articles:

Changing the load balancing policy in ESXi using Tech Support Mode:
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1011520

Specifying the NIC teaming policy from the command line in ESX 4.0:
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1019864

1 comment:

Anonymous said...

Can you please guide us for trnsition from 4 to 5 in ESXi.