Host Configuration
Configuring Host IP Addresses
- Modify the parameters of host ports in their respective configuration files. The following is an example configuration for port eth1.
linux-x8bt:~ # cat /etc/sysconfig/network/ifcfg-eth1 BOOTPROTO='static' BROADCAST='' ETHTOOL_OPTIONS='' IPADDR='192.168.5.25' NETMASK='255.255.255.0' MTU='' NAME='' NETWORK='' REMOTE_IPADDR='' STARTMODE='auto'
- Restart the network service.
For SLES 11, run the following command:
/etc/init.d/network restart
For SLES 12 and 15, run the following command:
systemctl restart network.service
Checking iSCSI Software on the Host
After SUSE is installed, run the rpm -qa |grep iscsi command to check the iSCSI software installation.
[root@root ~]# rpm -qa |grep iscsi
yast-iscsi-client-2.17.42-1.4
yast-iscsi-server-2.17.11-1.58
open-iscsi-2.0.873-0.32.1
The output shows that iSCSI software is installed.
If iSCSI software is not installed or the installed iSCSI software is of an early version, use the YaST tool to install or upgrade the software as follows:
- On the command-line interface (CLI), enter yast to start the tool.Figure 5-9 YaST tool interface
In the menu on the left, choose Software.
- In the menu on the right, choose Software Management.Figure 5-10 Software management
- In Search, enter iscsi to query the iSCSI software.Figure 5-11 Querying the iSCSI software
- In the output, choose the iSCSI software package that you want to install.Figure 5-12 iSCSI software package
- Choose Action and press Enter. In the menu that is displayed, choose Install.Figure 5-13 Installing the software
- Choose Accept to start the software installation.Figure 5-14 Accept installation
- After the installation is complete, choose Quit to exit from the YaST tool.Figure 5-15 Exiting from the YaST tool
Configuring Initiators
- Start the iSCSI service.
For SLES 11, run the following command:
/etc/init.d/open-iscsi start
For SLES 12 and 15, run the following command:systemctl start iscsi.service
- View the host initiator information.
[root@root ~]#cat /etc/iscsi/initiatorname.iscsi InitiatorName=iqn.1996-04.de.suse:01:fd266e7ae4e4
The output shows that the host initiator name is iqn.1996-04.de.suse:01:fd266e7ae4e4.
An iSCSI initiator name must comply with the following format:
iqn.domaindate.reverse.domain.name:optional name
An iSCSI initiator name contains only lower-case letters, digits, hyphens (-), periods (.), and colons (:).
An iSCSI initiator name can contain a maximum of 223 characters.
- Query targets.
For example, if the service IP address of the storage port is 192.168.5.6, run the following command on the host to query targets:
[root@root ~]# iscsiadm -m discovery -t st -p 192.168.5.6 192.168.5.6:3260,8199 iqn.2006-08.com.huawei:oceanstor:2100238256791322::22006:192.168.5.6
- Log in to the target.
[root@root ~]# iscsiadm -m node -p 192.168.5.6 -l Logging in to [iface: default, target: iqn.2006-08.com.huawei:oceanstor:2100238256791322::22006:192.168.5.6, portal: 192.168.5.6,3260] (multiple) Login to [iface: default, target: iqn.2006-08.com.huawei:oceanstor:2100238256791322::22006:192.168.5.6, portal: 192.168.5.6,3260] successful.
- Configure the iSCSI service to run upon system startup.
For SLES 11, run the following command:
chkconfig open-iscsi on
For SLES 12 and 15, run the following command:systemctl enable iscsi.service
- Modify the iSCSI timeout parameter. The default iSCSI timeout period of a Linux host is 120s, which results in a long failover time. You can follow the instructions in the FAQ to modify the parameter based on site requirements.
- Configure the host to automatically access the target upon startup.
[root@root ~ ]# iscsiadm -m node -o update -n node.startup -v automatic
- If CHAP authentication is not required between the storage system and host, the host initiator configuration is completed. If CHAP authentication is required, run the iscsiadm command.
[root@root ~]# iscsiadm -m node -o update -p 192.168.5.6 -n node.session.auth.authmethod -v CHAP [root@root ~]# iscsiadm -m node -o update -p 192.168.5.6 -n node.session.auth.username -v root [root@root ~]# iscsiadm -m node -o update -p 192.168.5.6 -n node.session.auth.password -v huawei123456
After the configuration is complete, run the following command on SLES 11 to restart the iSCSI service:
[root@root ~]# /etc/init.d/iscsi restart
For SLES 12 and 15, run the following command to restart the iSCSI service:
[root@root ~]# systemctl restart iscsi.service
When the iscsiadm command is executed, the user name and password of the initiator that was added to the storage system are required. If the user name and password used in this command are different from the initiator's, you will fail to establish connections between the storage system and the host.
The command syntax is as follows:
iscsiadm -m node -o update -p targetip -n node.session.auth.authmethod -v CHAP iscsiadm -m node -o update -p targetip -n node.session.auth.username -v username iscsiadm -m node -o update -p targetip -n node.session.auth.password -v password