In my last post Configuring Multipathing for Software iSCSI Using Port Binding we saw how to configure port binding and achieve multipathing for software iSCSI using GUI. In this post we will learn how to achieve the same using CLI.
I have posted an article Managing vSphere Network From Command Line sometime back and we will be using some commands to configure the network first. So lets begin.
1: Verify number of uplinks available on Esxi host
# esxcli network nic list
2: List all Standard vSwitch along with associated uplink
# esxcli network vswitch standard list
So we have 3 uplinks on Esxi host here: vmnic0,vmnic1 and vmnic2. Out of this vmnic0 is connected to vSwitch0 and providing the management network. We will create a new vswitch and use vmnic1 and vmnic2 as uplink to that vswitch.
3: Create a standard vSwitch by name iscsi-vSwitch
# esxcli network vswitch standard add -v iscsi-vSwitch -P 256
4: Add vmnic1 and vmnic2 as uplink to “iscsi-vSwitch”
# esxcli network vswitch standard uplink add -u=vmnic1 -v=iscsi-vSwitch
# esxcli network vswitch standard uplink add -u=vmnic2 -v=iscsi-vSwitch
5: Make the uplinks as active
# esxcli network vswitch standard policy failover set -a vmnic1,vmnic2 -v iscsi-vSwitch
6: Add 2 portgroups (iscsi-PG1 and iscsi-PG2) to iscsi-vSwitch
# esxcli network vswitch standard portgroup add -p=iscsi-PG1 -v=iscsi-vSwitch
# esxcli network vswitch standard portgroup add -p=iscsi-PG2 -v=iscsi-vSwitch
7: Associate the uplinks with the correct portgroups
# esxcli network vswitch standard portgroup policy failover set -a vmnic1 -p iscsi-PG1
# esxcli network vswitch standard portgroup policy failover set -a vmnic2 -p iscsi-PG2
8: Create the VMkernel interfaces and associate them with the portgroups iscsi-PG1 and iscsi-PG2
# esxcli network ip interface add -p iscsi-PG1 -i vmk1
# esxcli network ip interface add -p iscsi-PG2 -i vmk2
# esxcli network ip interface ipv4 set -i vmk1 -I 192.168.0.161 -N 255.255.255.0 -t static
# esxcli network ip interface ipv4 set -i vmk2 -I 192.168.0.162 -N 255.255.255.0 -t static
9: Enable and Configure the iSCSI Software Adapter
# esxcli iscsi software set -e true
10: Configure IP addresses of the iSCSI targets
# esxcli iscsi adapter discovery sendtarget add -a 192.168.0.90:3260 -A vmhba33
Configure Port Binding
11: Bind the VMkernel network adapter to the iSCSI adapter
# esxcli iscsi networkportal add –nic vmk1 –adapter vmhba33
# esxcli iscsi networkportal add –nic vmk2 –adapter vmhba33
Note: Binding details can be verified by using the following command:
# esxcli iscsi networkportal list –adapter vmhba33
iSCSI Re-login
If you have an already established iSCSI session before port binding configuration, you can remove the existing iSCSI sessions and log in again for the port binding configuration to take effect.… Read More
Like this:
Like Loading...