All NIC And iSCSI Port Pairs To a Single vSwitch – Don’t Forget The Binding!

In an iSCSI setup (software initiator or HBA), if your host has more than one pNIC, there are two types of configuration you can build. First one a two vSwitches type of configuration where you have a separate vSwitch for each network adapter and VMKernel iSCSI port pair in a 1:1 mapping as shown on the picture below,

The second type, my preferred one particularly in my home lab, an one vSwitch type of configuration where multiple network adapter and VMKernel iSCSI port pairs sharing the same vSwitch as shown on the picture below:

For that kind of config, when you have a single vSwitch with multiple VMKernel iSCSI ports, something many time overlooked by the admins is the binding. Indeed in such very specific case, single vSwitch configuration, the default binding is not optimized. Although it works, you won’t have the redundancy and multipathing you would expect! Indeed by default the VMKernel iSCSI ports you add are all bind to a single vmnic.

The iSCSI SAN Configuration Guide for vSphere 4.1 is clear about such configuration. You must override the default setup and make sure that each port maps to only one active NIC. But that’s only half of what needs to be done to configure properly your VMKernel iSCSI ports!

So after you map VMKernel iSCSI ports to network adapters, the second step consists of using the esxcli command to bind the VMKernel iSCSI ports (vmk) to the iSCSI adapters (vmhba). The following example shows how to connect the VMKernel iSCSI ports vmk1 and vmk2 to the software iSCSI adapter vmhba33.

  1. Connect vmk1 to vmhba33: esxcli swiscsi nic add -n vmk1 -d vmhba33
  2. Connect vmk2 to vmhba33: esxcli swiscsi nic add -n vmk2 -d vmhba33
  3. Verify vmhba33 configuration: esxcli swiscsi nic list -d vmhba33 -> Both vmk1 and vmk2 should be listed.

If you display the Paths view for the vmhba33 adapter through the vSphere Client, you see that the adapter uses two paths to access the same target. The runtime names of the paths are vmhba33:C1:T1:L0 and vmhba33:C2:T1:L0. C1 and C2 in this example indicate the two network adapters that are used for multipathing.

Make sure to have a read at this VMware KB for an issue I ran into because I skipped step# 6, page 37 of the iSCSI SAN Configuration Guide when setting up iSCSI in my home lab 🙂

A video is much better to get the whole picture so I invite you to watch this one below:

The fact that you need to use both the vCenter Client and the vSphere CLI to achieve properly this type of configuration is a bit annoying and can lead to errors or I would say to incomplete configuration. Indeed, even half configured it works and therefore you might think the work is successful, I have redundancy and multipathing but actually you haven’t!

There should be a popup in vCenter Client warning you about the remaining steps to properly complete the configuration. A simple message telling you: Hey buddy, don’t forget the ESXCLI bit to get all set properly! Well not literally but you see what I mean here 🙂

About PiroNet

Didier Pironet is an independent blogger and freelancer with +15 years of IT industry experience. Didier is also a former VMware inc. employee where he specialised in Datacenter and Cloud Infrastructure products as well as Infrastructure, Operations and IT Business Management products. Didier is passionate about technologies and he is found to be a creative and a visionary thinker, expressing with passion and excitement, hopefully inspiring and enrolling people to innovation and change.
This entry was posted in Uncategorized. Bookmark the permalink.

4 Responses to All NIC And iSCSI Port Pairs To a Single vSwitch – Don’t Forget The Binding!

  1. Vladan says:

    Nice video Didier,

    It really adds more value to the post. But an supplementary effort must be made for the creation !!!

    In one of those podcasts with John Troyer quite long time ago Chad was actually saying that this will be a GUI feature in future release of vSphere. I mean to bind those NICs to the vmkernel iSCSI interfaces. This is not the case for vSphere 4.1 but maybe in the 4.2…. ?

    Let’s see. Definitely you post deserve some light when it comes to the setup of iSCSI in vSphere…. -:) Well done.

  2. Pingback: Tweets that mention All NIC And iSCSI Port Pairs To a Single vSwitch – Don’t Forget The Binding! « DeinosCloud --

  3. Carl says:

    I am curious why you prefer the single vswitch (multiple uplink arrangement) rather than the one vswitch, one uplink arrangement ?


Leave a Reply

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

You are commenting using your 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 )

Connecting to %s