Storage array IP address, CHAP username and password will be provided by ITS Enterprise Storage

# Install iscsi-initiator-utils

  • yum install iscsi-initiator-utils

# Edit /etc/iscsi/iscsid.conf and enter username password and storage IP address (see example file at the bottom of this article)

# Start the iscsi service

  • /etc/init.d/iscsi start

# Discover target, replace question marks with IP address given by ITS Enterprise Storage

  • iscsiadm -m discovery -t sendtargets -p ???.???.???.???

# Restart iscsi service

  • /etc/init.d/iscsi restart

# Run dmesg to get the device name for the new device. (e.g. /dev/sdb) or view syslog

  • dmesg
  • tail /var/log/messages

# Run fdisk and create new primary paritition

  • fdisk /dev/sdb
  • create new primary partition
  • set partition's system id (e.g. LMV or LINUX)
  • write table to disk
  • options n, p, default, default, t, 1, 83, p, w)

# If using LVM (pvcreate, vgcreate, lvcreate)

  • mke2fs /dev/sdb1  (or mkfs.ext3 /dev/sdb1)

# Create a mount point

  • mkdir /mnt/iscsi

# Mount the iscsi storage device

  • mount /dev/sda1 /mnt/iscsi

# Turn on the iscsi service (so it starts at boot)

  • chkconfig iscsi on

# edit /etc/fstab (synatax may differ if using LVM)

  • /dev/sdb1 /mnt/iscsi ext3 _netdev 0 0

# The _netdev option is important so that it doesn't try mounting the target before the network is available

 

EXAMPLE /etc/iscsi/iscsid.config

################
# iSNS settings
################
# Address of iSNS server
isns.address = ***.***.***.***
isns.port = 3260

# *************
# CHAP Settings
# *************

# To enable CHAP authentication set node.session.auth.authmethod
# to CHAP. The default is None.
node.session.auth.authmethod = CHAP

# To set a CHAP username and password for initiator
# authentication by the target(s), uncomment the following lines:
node.session.auth.username = ********
node.session.auth.password = ********

# To enable CHAP authentication for a discovery session to the target
# set discovery.sendtargets.auth.authmethod to CHAP. The default is None.
discovery.sendtargets.auth.authmethod = CHAP

# To set a discovery session CHAP username and password for the initiator
# authentication by the target(s), uncomment the following lines:
discovery.sendtargets.auth.username = ********
discovery.sendtargets.auth.password = ********

 

Article number: 
1394
Last updated: 
May 19, 2016