Creating ISCSI vmkernel portgroup with CLI

how do u configure your ISCSI network for Load Balancing with ESxi4 ,4.1 , 5.0 ?

## On this Example we’ll use 3 network adapters: vmnic1,vmnic2,vmnic3:

esxcfg-vswitch -a vSwitch2

# for Jumbo Frame Support:

esxcfg-vswitch -m 9000 vSwitch2

# Lets Create port groups

esxcfg-vswitch -A ISCSI1 vSwitch2

esxcfg-vswitch -A ISCSI2 vSwitch2

esxcfg-vswitch -A ISCSI3 vSwitch2

# now we have vSwitch2 containing 2 portgroups, lets populate them with vmkernel port groups that support Jumbo  Frame ( dont forget to configure your storage device and your physical switch as well, Jumbo frame needs End to End configuration):

esxcfg-vmknic -i -a 192.168.1.1 -n 255.255.255.0 ISCSI1 -m 9000

esxcfg-vmknic -i -a 192.168.1.2 -n 255.255.255.0 ISCSI2 -m 9000

esxcfg-vmknic -i -a 192.168.1.3 -n 255.255.255.0 ISCSI3 -m 9000

# now we need to 2 Uplinks ( vmnics) to this switch

esxcfg-vswitch -L vmnic1 vSwitch2

esxcfg-vswitch -L vmnic2 vSwitch2

esxcfg-vswitch -L vmnic3 vSwitch2

 

# finally we need to have each vmkernel port group to use its own network adapter:

#esxcfg-vswitch –p iSCSI1 –N vmnic3 vSwitch2

#esxcfg-vswitch –p iSCSI1 –N vmnic2 vSwitch2

#esxcfg-vswitch –p iSCSI2 –N vmnic1 vSwitch2

#esxcfg-vswitch –p iSCSI2 –N vmnic3 vSwitch2

#esxcfg-vswitch –p iSCSI3 –N vmnic1 vSwitch2

#esxcfg-vswitch –p iSCSI3 –N vmnic2 vSwitch2

### the Result will look like this:

Switch Name Num Ports Used Ports Configured Ports MTU Uplinks

vSwitch2         64         7           64                                         9000 vmnic3,vmnic2,vmnic1

PortGroup Name VLAN ID Used Ports Uplinks

iSCSI3                        0              1                 vmnic3

iSCSI2                        0              1                 vmnic2

iSCSI1                         0             1                  vmnic1

#To enable the iSCSI initiator through the CLI type the following command:

#esxcfg-swiscsi –e

# if your are using esx4.0, 4.1 u need to configure the ISCSI binding for your iscsi software initiator (vmhba33 for example )through command line:

Note: For ESXI5 u can just configure it through the Binding tab in the ISCSI software initiator properties.

to find out wich vmkernel portgroup u need to bind :

esxcfg-vmknic -l (suppose the output is vmk1,2,3):

vmkiscsi-tools -V -a  vmk1  vmhba33

vmkiscsi-tools -V -a  vmk2  vmhba33

vmkiscsi-tools -V -a  vmk3  vmhba33

# After this, check performance of those vmnics and u’ll find out that every each of the network adapter is used

# another thing u can also use is the RoundRobin PSP for your Datastore ( please read carefully your storage vendor Recomendation per your Storage Device )