Binding All NIC And iSCSI Port Pairs To a Single vSwitch
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. Youmust 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 theesxcli 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.
- Connect vmk1 to vmhba33: esxcli swiscsi nic add -n vmk1 -d vmhba33
- Connect vmk2 to vmhba33: esxcli swiscsi nic add -n vmk2 -d vmhba33
- 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 incompleted configuration. Indeed, even half configured it works and therefore you might think the work is successful, I have redundancy and multi-pathing but actually you haven’t!
Categorised as: VMWare/ESX
Leave a Reply
You must be logged in to post a comment.