Connect through SSH with the ESX server and become root
Create a vSwitch
esxcfg-vswitch -a vSwitch_iscsi
Enable jumbo packages on the vSwitch, note: your switch must support this!
esxcfg-vswitch -m 9000 vSwitch_iscsi
Add virtual NIC’s to the vSwitch, for throughput resins it is recommended to have 2 NIC’s per physical network interface. In this case I have 4 NIC for iSCSI.
esxcfg-vswitch -A iSCSI01 vSwitch_iscsi esxcfg-vswitch -A iSCSI02 vSwitch_iscsi esxcfg-vswitch -A iSCSI03 vSwitch_iscsi esxcfg-vswitch -A iSCSI04 vSwitch_iscsi esxcfg-vswitch -A iSCSI05 vSwitch_iscsi esxcfg-vswitch -A iSCSI06 vSwitch_iscsi esxcfg-vswitch -A iSCSI07 vSwitch_iscsi esxcfg-vswitch -A iSCSI08 vSwitch_iscsi
Configure an IP for each virtual NIC and enable Jumbo package on the virtual NIC.
esxcfg-vmknic -a -i 10.31.54.60 -n 255.255.255.0 -m 9000 iSCSI01 esxcfg-vmknic -a -i 10.31.54.61 -n 255.255.255.0 -m 9000 iSCSI02 esxcfg-vmknic -a -i 10.31.54.62 -n 255.255.255.0 -m 9000 iSCSI03 esxcfg-vmknic -a -i 10.31.54.63 -n 255.255.255.0 -m 9000 iSCSI04 esxcfg-vmknic -a -i 10.31.54.64 -n 255.255.255.0 -m 9000 iSCSI05 esxcfg-vmknic -a -i 10.31.54.65 -n 255.255.255.0 -m 9000 iSCSI06 esxcfg-vmknic -a -i 10.31.54.66 -n 255.255.255.0 -m 9000 iSCSI07 esxcfg-vmknic -a -i 10.31.54.67 -n 255.255.255.0 -m 9000 iSCSI08
Next you have to add the physical interfaces to the vSwitch, this can only be done through the GUI (vClient). If you don’t see the added switch, click refresh.
When the physical NIC’s are added to the vSwitch, you now have to map the virtual NIC with the physical one.
esxcfg-vswitch -p iSCSI01 -N vmnic4 vSwitch_iscsi esxcfg-vswitch -p iSCSI02 -N vmnic4 vSwitch_iscsi esxcfg-vswitch -p iSCSI03 -N vmnic5 vSwitch_iscsi esxcfg-vswitch -p iSCSI04 -N vmnic5 vSwitch_iscsi esxcfg-vswitch -p iSCSI05 -N vmnic6 vSwitch_iscsi esxcfg-vswitch -p iSCSI06 -N vmnic6 vSwitch_iscsi esxcfg-vswitch -p iSCSI07 -N vmnic7 vSwitch_iscsi esxcfg-vswitch -p iSCSI08 -N vmnic7 vSwitch_iscsi
Next check your configuration
~ # esxcfg-vswitch -l Switch Name Num Ports Used Ports Configured Ports MTU Uplinks vSwitch0 128 6 128 1500 vmnic0,vmnic1,vmnic2,vmnic3 PortGroup Name VLAN ID Used Ports Uplinks VM Network 0 0 vmnic0,vmnic1,vmnic2,vmnic3 Management Network 0 1 vmnic0,vmnic1,vmnic2,vmnic3 Switch Name Num Ports Used Ports Configured Ports MTU Uplinks vSwitch_iscsi 128 13 128 9000 vmnic4,vmnic5,vmnic6,vmnic7 PortGroup Name VLAN ID Used Ports Uplinks iSCSI08 0 1 vmnic4,vmnic5,vmnic6 iSCSI07 0 1 vmnic4,vmnic5,vmnic6 iSCSI06 0 1 vmnic4,vmnic5,vmnic7 iSCSI05 0 1 vmnic4,vmnic5,vmnic7 iSCSI04 0 1 vmnic4,vmnic6,vmnic7 iSCSI03 0 1 vmnic4,vmnic6,vmnic7 iSCSI02 0 1 vmnic5,vmnic6,vmnic7 iSCSI01 0 1 vmnic5,vmnic6,vmnic7
Next you have to enable the software iSCSI adapter for ESX
esxcfg-swiscsi -e
Check in the GUI what the “vmnba” port number is of the software iSCSI adpater, and add the kernel ports to this adapter.
The kernel port numbers can be found in the GUI under the vSwitch. These number are added bijou ESX when adding a virtual NIC.
esxcli swiscsi nic add -n vmk1 -d vmhba37 esxcli swiscsi nic add -n vmk2 -d vmhba37 esxcli swiscsi nic add -n vmk3 -d vmhba37 esxcli swiscsi nic add -n vmk4 -d vmhba37 esxcli swiscsi nic add -n vmk5 -d vmhba37 esxcli swiscsi nic add -n vmk6 -d vmhba37 esxcli swiscsi nic add -n vmk7 -d vmhba37 esxcli swiscsi nic add -n vmk8 -d vmhba37
Now you can add a iSCSI target to the software adapter in the GUI (vCenter). After that you have to refresh the adapter and ESX will find the LUN’s if access is configured.