CentOS 5
Sponsored Link

Configure iSCSI Initiator
2015/01/13
 
Configure iSCSI Initiator.
This example is based on the environment below.
 
dlp.srv.world
[10.0.0.30] - iSCSI Target

 
www.srv.world
[10.0.0.31] - iSCSI Initiator
[1] Configure iSCSI Initiator.
[root@www ~]#
yum -y install iscsi-initiator-utils
[root@www ~]#
vi /etc/iscsi/iscsid.conf
# line 34: uncomment

node.session.auth.authmethod = CHAP
# line 38,39: uncomment and set username and password which set on iSCSI Target

node.session.auth.username =
username

node.session.auth.password =
password
[root@www ~]#
/etc/rc.d/init.d/iscsid start

Starting iSCSI daemon: iscsi: registered transport (cxgb3i)
iscsi: registered transport (bnx2i)
iscsi: registered transport (tcp)
iscsi: registered transport (iser)
iscsi: registered transport (be2iscsi)
[ OK ]
[ OK ]
[root@www ~]#
chkconfig iscsi on

[root@www ~]#
chkconfig iscsid on
# discover target

[root@www ~]#
iscsiadm -m discovery -t sendtargets -p 10.0.0.30

10.0.0.30:3260,1 iqn.2011-06.world.srv:target0
# confirm status after discovery

[root@www ~]#
iscsiadm -m node -o show

# BEGIN RECORD 2.0-872
node.name = iqn.2011-06.world.srv:target0
node.tpgt = 1
node.startup = automatic
iface.hwaddress = <;empty>
iface.ipaddress = <;empty>
iface.iscsi_ifacename = default
iface.net_ifacename = <;empty>
iface.transport_name = tcp
iface.initiatorname = <;empty>
node.discovery_address = 10.0.0.30
node.discovery_port = 3260
node.discovery_type = send_targets
node.session.initial_cmdsn = 0
node.session.initial_login_retry_max = 8
node.session.xmit_thread_priority = -20
node.session.cmds_max = 128
node.session.queue_depth = 32
node.session.auth.authmethod = CHAP
node.session.auth.username = username
node.session.auth.password = ********
node.session.auth.username_in = <;empty>
node.session.auth.password_in = <;empty>
node.session.timeo.replacement_timeout = 120
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 30
node.session.err_timeo.tgt_reset_timeout = 30
node.session.err_timeo.host_reset_timeout = 60
node.session.iscsi.FastAbort = Yes
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.session.iscsi.DefaultTime2Retain = 0
node.session.iscsi.DefaultTime2Wait = 2
node.session.iscsi.MaxConnections = 1
node.session.iscsi.MaxOutstandingR2T = 1
node.session.iscsi.ERL = 0
node.conn[0].address = 10.0.0.30
node.conn[0].port = 3260
node.conn[0].startup = manual
node.conn[0].tcp.window_size = 524288
node.conn[0].tcp.type_of_service = 0
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_interval = 5
node.conn[0].timeo.noop_out_timeout = 5
node.conn[0].iscsi.MaxXmitDataSegmentLength = 0
node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144
node.conn[0].iscsi.HeaderDigest = None
node.conn[0].iscsi.IFMarker = No
node.conn[0].iscsi.OFMarker = No
# END RECORD

# login to target

[root@www ~]#
iscsiadm -m node --login

Logging in to [iface: default, target: iqn.2011-06.world.srv:target0, portal: 10.0.0.30,3260]
  Vendor: IET       Model: Controller        Rev: 0001
  Type:   RAID                               ANSI SCSI revision: 05
  Vendor: IET       Model: VIRTUAL-DISK      Rev: 0001
  Type:   Direct-Access                      ANSI SCSI revision: 05
SCSI device sda: 104857600 512-byte hdwr sectors (53687 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
SCSI device sda: 104857600 512-byte hdwr sectors (53687 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
sd 0:0:0:1: Attached scsi disk sda
Login to [iface: default, target: iqn.2011-06.world.srv:target0, portal: 10.0.0.30,3260] successful.

# confirm established session

[root@www ~]#
iscsiadm -m session -o show

tcp: [1] 10.0.0.30:3260,1 iqn.2011-06.world.srv:target0
# confirm partitions

[root@www ~]#
cat /proc/partitions

major minor  #blocks  name

 253     0   20971520 vda
 253     1     104391 vda1
 253     2   20860402 vda2
 252     0   16744448 dm-0
 252     1    4096000 dm-1
   8     0   52428800 sda
# added new device provided from target as [sda]
Matched Content
 
Tweet