How to install and Configuring manual or automatic node login with iSCSI Initiator
Configuring manual or automatic node login with iSCSI
1. Install the software package:
[root@Centos7 ~]# yum -y install iscsi-initiator-utils
2. Configure the iqn name for the initiator:
[root@Centos7 ~]# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2017-12.com.centos7:Centos7
3. Edit the iSCSI initiator configuration:
# vi /etc/iscsi/iscsid.conf
# To manually startup the session set to "manual". The default is automatic.
node.startup = automatic
# To enable CHAP authentication
node.session.auth.authmethod = CHAP
# To set a CHAP username and password for initiator
node.session.auth.username = iscsiadmin
node.session.auth.password = P@$$w0rd
4. Start iSCSI initiator daemon:
[root@Centos7 ~]# systemctl start iscsi
[root@Centos7 ~]# systemctl enable iscsi
5.Discovering targets in our iSCSI server:
[root@Centos7 ~]# iscsiadm --mode discovery -t sendtargets --portal 172.16.20.90
172.16.20.90:3260,1 iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7
10.10.0.175:3260,1 iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7
[root@Centos7 ~]#
6. Trying to login with the iSCSI LUN
[root@Centos7 ~]# iscsiadm -m node --targetname "iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7" --portal "172.16.20.90:3260" --login
Logging in to [iface: default, target: iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7, portal: 172.16.20.90,3260] (multiple)
Login to [iface: default, target: iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7, portal: 172.16.20.90,3260] successful.
7. With this command is reponsible of the update of iSCSI targets database for the files located in /var/lib/iscsi/ :
[root@Centos7 172.16.20.90,3260]# cat /var/lib/iscsi/send_targets/172.16.20.90,3260/st_config
# BEGIN RECORD 6.2.0.874-2
discovery.startup = manual
discovery.type = sendtargets
discovery.sendtargets.address = 172.16.20.90
discovery.sendtargets.port = 3260
discovery.sendtargets.auth.authmethod = None
discovery.sendtargets.timeo.login_timeout = 15
discovery.sendtargets.use_discoveryd = No
discovery.sendtargets.discoveryd_poll_inval = 30
discovery.sendtargets.reopen_max = 5
discovery.sendtargets.timeo.auth_timeout = 45
discovery.sendtargets.timeo.active_timeout = 30
discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
# END RECORD
8. – Checking the status session with the target:
[root@Centos7 172.16.20.90,3260]# iscsiadm --mode session --op show
tcp: [1] 172.16.20.90:3260,1 iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7 (non-flash)
tcp: [2] 10.10.0.175:3260,1 iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7 (non-flash)
[root@Centos7 172.16.20.90,3260]#
1. Install the software package:
[root@Centos7 ~]# yum -y install iscsi-initiator-utils
2. Configure the iqn name for the initiator:
[root@Centos7 ~]# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2017-12.com.centos7:Centos7
3. Edit the iSCSI initiator configuration:
# vi /etc/iscsi/iscsid.conf
# To manually startup the session set to "manual". The default is automatic.
node.startup = automatic
# To enable CHAP authentication
node.session.auth.authmethod = CHAP
# To set a CHAP username and password for initiator
node.session.auth.username = iscsiadmin
node.session.auth.password = P@$$w0rd
4. Start iSCSI initiator daemon:
[root@Centos7 ~]# systemctl start iscsi
[root@Centos7 ~]# systemctl enable iscsi
5.Discovering targets in our iSCSI server:
[root@Centos7 ~]# iscsiadm --mode discovery -t sendtargets --portal 172.16.20.90
172.16.20.90:3260,1 iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7
10.10.0.175:3260,1 iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7
[root@Centos7 ~]#
6. Trying to login with the iSCSI LUN
[root@Centos7 ~]# iscsiadm -m node --targetname "iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7" --portal "172.16.20.90:3260" --login
Logging in to [iface: default, target: iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7, portal: 172.16.20.90,3260] (multiple)
Login to [iface: default, target: iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7, portal: 172.16.20.90,3260] successful.
7. With this command is reponsible of the update of iSCSI targets database for the files located in /var/lib/iscsi/ :
[root@Centos7 172.16.20.90,3260]# cat /var/lib/iscsi/send_targets/172.16.20.90,3260/st_config
# BEGIN RECORD 6.2.0.874-2
discovery.startup = manual
discovery.type = sendtargets
discovery.sendtargets.address = 172.16.20.90
discovery.sendtargets.port = 3260
discovery.sendtargets.auth.authmethod = None
discovery.sendtargets.timeo.login_timeout = 15
discovery.sendtargets.use_discoveryd = No
discovery.sendtargets.discoveryd_poll_inval = 30
discovery.sendtargets.reopen_max = 5
discovery.sendtargets.timeo.auth_timeout = 45
discovery.sendtargets.timeo.active_timeout = 30
discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
# END RECORD
8. – Checking the status session with the target:
[root@Centos7 172.16.20.90,3260]# iscsiadm --mode session --op show
tcp: [1] 172.16.20.90:3260,1 iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7 (non-flash)
tcp: [2] 10.10.0.175:3260,1 iqn.2004-04.com.sanstorage:tvs-671:iscsi.sanstorage.0016e7 (non-flash)
[root@Centos7 172.16.20.90,3260]#
Comments