Install Open-iSCSI Initiator

Type the following command at a shell prompt:

sudo apt-get install open-iscsi

Open-iSCSI default configuration

Default configuration file could be located at /etc/iscsi/iscsid.conf or ~/.iscsid.conf. Open /etc/iscsi/iscsid.conf file:

vi /etc/iscsi/iscsid.conf

Set node.session.auth.username, node.session.auth.password and other parameter as follows:

node.startup = automatic
node.session.auth.username = MY-ISCSI-USER
node.session.auth.password = MY-ISCSI-PASSWORD
discovery.sendtargets.auth.username = MY-ISCSI-USER
discovery.sendtargets.auth.password = MY-ISCSI-PASSWORD
node.session.timeo.replacement_timeout = 120
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.noop_out_interval = 10
node.conn[0].timeo.noop_out_timeout = 15
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.conn[0].iscsi.MaxRecvDataSegmentLength = 65536

Save and close the file. Restart open-iscsi service:

/etc/init.d/open-iscsi restart

Now you need to run a discovery against the iscsi target host:

iscsiadm -m discovery -t sendtargets -p ISCSI-SERVER-IP-ADDRESS

Note down the record id (such as iqn.2001-05.com.equallogic:0-8a0906-2a787a201-c80000003cb47834-servername) found by the discovery. You need the same for login. Login, must use a node record id found by the discovery:

iscsiadm –mode node –targetname iqn.2001-05.com.equallogic:0-8a0906-2a787a201-c80000003cb47834-servername –portal 192.168.1.60:3260 –login

Finally restart the service again:

/etc/init.d/open-iscsi restart

One Response to “Connect to a iSCSI Target with Ubuntu”

  1. http://www.startaid.com/viewurl.php?link=http://scottwoods718.terapad.com/index.cfm~ says:

    Excellent post. I was checking continuously this blog and I am impressed! Extremely useful information specifically the last part :) I care for such information much. I was looking for this certain information for a long time. Thank you and best of luck.

Leave a Reply