1 Make sure “iscsi” and “iscsid” service 2, 3, 4, 5 are on for startup .
Example chkconfig iscsi on chkconfig iscsid on chkconfig --list iscsi chkconfig --list iscsid
2 Get the host’s IQN (iSCSI qualified name).
# cat /etc/iscsi/initiatorname.iscsi
3 Configure the network for iSCSI ports.
- Determine the iSCSI port names using the # ifconfig -a ……….. -a means all..
- Set the STATIC IP address for the iSCSI initiator ports in same subnet.
- The following example shows this line added:
- IPADDR=172.87.xxx.xxx
#vim /etc/sysconfig/network-scripts/ifcfg-Edit: BOOTPROTO=none
ONBOOT=yes NM_CONTROLLED=no IPADDR=172.87.xxx.xxx NETMASK=255.255.240.0 Restart network services. $ sudo /etc/init.d/networking restart
To list existing interfaces, specify iscsiadm –m iface.
To list all attributes of a single iface binding, specify iscsiadm –m iface –I ifacename.
The following example shows an iface creation:
Example
iscsiadm –m iface –I iface0 –o new
iscsiadm –m iface –I iface0 –o update –n iface.net_ifacename –v
iscsiadm –m iface –I iface1 –o new
iscsiadm –m iface –I iface1 –o update –n iface.net_ifacename –v
Update the iface settings (MAC, IP, and IQN).
Example
iscsiadm -m iface -I iface0 -o update -n iface.hwaddress
iscsiadm -m iface -I iface0 -o update -n iface.ipaddress -v
iscsiadm -m iface -I iface0 -o update -n iface.initiatorname -v
Establish the iSCSI sessions between initiators and targets.
Once you complete this step, four sessions are established.
Discover iSCSI targets.
Example
iscsiadm –m discovery –t sendtargets –p 172.68.0.1:3260 –I iface0 –P 1
iscsiadm –m discovery –t sendtargets –p 172.68.1.1:3260 –I iface1 –P 1
The IQN looks like the following:
iqn.1992-01.com.lsi:2565.00531d7be3
Record the IQN (it will be the same with each discovery) on the worksheet for the next step.
Using ifaces, log in to create sessions between the iSCSI initiators and iSCSI targets.
Example
To log in session by session (do this four times, specifying the IQN and IP address for each target port):
iscsiadm -m node -T -I iface# -p -l
To connect to all arrays:
iscsiadm -m node -L all
For verification, list the iSCSI sessions established on the host.
Example
iscsiadm -m session