Configure iSCSI Port Binding in VMware ESXi

1

iSCSI Port Binding is used when one needs multiple paths to each iSCSI target. The default iSCSI configuration on the VMware ESXi host creates only one path to each iSCSI target.

Before vSphere 5.0, administrators had to configure iSCSI port binding using the command line. There was no other of doing it and was quite confusing, to say the least.

VMware then introduced a graphical user interface which continues until vSphere 6.0, to perform iSCSI port binding for the software iSCSI initiator.

We will be performing this changes using multiple vmkernel ports on the VMware ESXi host.

However, there are some considerations to be made when using port binding. I have listed a few of them below:

  • The target array should reside on the subnet as the vmkernel ports.
  • All the vmkernel ports used should also be in the subnet.
  • Port binding does not support network routing at this time.

With that being said, let us work through by looking at an example so that we are clear with the concepts.

Configure iSCSI Port Binding using vSphere Web Client

In our case, we will be creating two vmkernel ports on a new vSwitch.
Select the ESXi host > Manage > Networking > Virtual Switches > Add Host Networking.
Configure iSCSI Port Binding in ESXi
Select New Standard Switch.
Configure iSCSI Port Binding in ESXi
Assign vmnic1 and vmnic2 from the list of available physical adapters.
Configure iSCSI Port Binding in ESXi
Give the label as iSCSI1 for the vmkernel port and leave the defaults.
Configure iSCSI Port Binding in ESXi
Provide the IP address for the iSCSI1 vmkernel port and click Next.
Configure iSCSI Port Binding in ESXi
Review all the settings and click on Finish.
Configure iSCSI Port Binding in ESXi
Now for the second vmkernel adapter, click on Networking > vmkernel adapter > Add a new vmkernel port.
Select an existing switch (vSwitch1), provide the name as iSCSI2 for the vmkernel port. Provide the IP address and click on Finish.
It should look something like the below.
Configure iSCSI Port Binding in ESXi
Next, we will be setting up the NIC teaming policy for the vmkernel ports that we just created.
Click on Networking > Virtual Switches > vSwitch1 > Select iSCSI1 > Click on Edit.
Go to Teaming and Failover Section >
  • Select the Load Balancing policy as Use Explicit failover order
  • Active Adapter as vmnic1
  • Unused Adapter as vmnic2

Configure iSCSI Port Binding in ESXi

It should look like the above image.
Next, select the second vmkernel port that we created, which is iSCSI2 and do not the exact opposite for the Active and Unused adapters.
Configure iSCSI Port Binding in ESXi
Well, we have finished setting up the networking part of the iSCSI port binding now.
Next step would be to create a Software iSCSI adapter. Click on the host > Manage > Storage > Software Adapters > Add > Software iSCSI adapter
Configure iSCSI Port Binding in ESXi
You will receive a confirmation dialogue box, click on Ok.
Configure iSCSI Port Binding in ESXi
Next, we will have to configure Network port binding for the Software iSCSI adapter that we just created.
From the Storage adapters section, select the vmhba33 adapter > Network Port Binding > Add
Select the two vmkernel ports that we created in the Networking part of the configuration and click on Ok.
Configure iSCSI Port Binding in ESXi
Now we will need to provide the Target IP Address which is the storage array in order to be able to see the LUNs.
Select the vmhba33 adapter > Targets > Dynamic Discovery > Add
Provide the target IP address or the Fully qualified domain name.
Configure iSCSI Port Binding in ESXi
Now you will have to perform a rescan of the HBA adapters in order to be able to see the LUNs presented from the target storage array.
Once the rescan completes, click on the Paths tab and you should be able to see two paths coming from the same array for the LUN that we have presented.
Configure iSCSI Port Binding in ESXi

Configure iSCSI Port Binding using ESXCLI

Another way to perform this activity is through esxcli. The steps would remain the same as done from the vSphere Web Client.

So let us quickly go through the steps required to perform this.

Create a new standard vSwitch called vSwitch1:

~ # esxcli network vswitch standard add -v vSwitch1

Once the switch is created we will create the two new portgroups called iSCSI1 and iSCSI2:

~ # esxcli network vswitch standard portgroup add -p iSCSI1 -v vSwitch1
~ # esxcli network vswitch standard portgroup add -p iSCSI2 -v vSwitch1

Next, we need to add the uplinks vmnic1 and vmnic2 to the new vSwitch:

~ # esxcli network vswitch standard uplink add -u vmnic1 -v vSwitch1
~ # esxcli network vswitch standard uplink add -u vmnic2 -v vSwitch1

Next steps would be to set them active.

~ # esxcli network vswitch standard policy failover set -a vmnic1,vmnic2 -v vSwitch1

We will now have to associate vmnic1 to the portgroup iSCSI1 and vmnic2 to iSCSI2 portgroup.

~ # esxcli network vswitch standard portgroup policy failover set -a vmnic1 -p iSCSI1
~ # esxcli network vswitch standard portgroup policy failover set -a vmnic2 -p iSCSI2

The last step would be to create the VMkernel interfaces and associate them with the portgroups we have just created and provide the correct IP addresses.

~ # esxcli network ip interface add -p iSCSI1 -i vmk1
~ # esxcli network ip interface add -p iSCSI2 -i vmk2
~ # esxcli network ip interface ipv4 set -i vmk1 -I 192.168.0.18 -N 255.255.255.0 -t static
~ # esxcli network ip interface ipv4 set -i vmk2 -I 192.168.0.28 -N 255.255.255.0 -t static

Once that is done the network configuration will be complete and will match as shown below.

Next, we will have to make the add the target IP address for the Software iSCSI Adapter that was created.

~ # esxcli iscsi adapter discovery sendtarget add -a 192.168.0.108:3260 -A vmhba33

The final step would be to perform the Network Port Binding.

~ # esxcli iscsi networkportal add --nic vmk1 --adapter vmhba33
~ # esxcli iscsi networkportal add --nic vmk2 --adapter vmhba33

Both the methods will achieve you the same results. You can also verify if multipathing is set correctly by running the below command which will list all the paths on the ESXi host.

~ # esxcli storage core path list

Configure iSCSI Port Binding in ESXi

The output of this command exactky mateches with the Paths that we saw earlier in the vSphere Web Client.

Well that is all I have for today! I hope this has been informative and thank you for reading!

Share.

About Author

I am Adil Arif, working as a Senior Technical Support Engineer at Rubrik as well as an independent blogger and founder of Enterprise Daddy. In my current role, I am supporting infrastructure related to Windows and VMware datacenters.

1 Comment

Leave A Reply