Connecting to an iSCSI server from Linux

IMPORTANT: never stop or kill the iscsid daemon while iSCSI disks are still present!


This document describes how to connection to an iSCSI server using Open-iSCSI from a Linux machine. I will asume Open-iSCSI has alread been installed

First setup the Initiator name in /etc/iscsi/initiatorname.iscsi. For example:

Next setup authenticaion options in /etc/iscsi/iscsid.conf, if needed. For example:

node.session.auth.authmethod = CHAP
node.session.auth.username = username
node.session.auth.password = password

discovery.sendtargets.auth.authmethod = CHAP
discovery.sendtargets.auth.username = username
discovery.sendtargets.auth.password = password

Setting up iSCSI interface

Creating a new iSCSI interface

iscsiadm -m iface -I iface0 -o new

Configuring an existing iSCSI interface

iscsiadm -m iface -I iface0 -o update -n iface.initiatorname -v This configures the interface initiatorname (sets it to in this example)

iscsiadm -m iface -I iface0 -o update -n iface.ipaddress -v

This configures interface iface0 to use as the source IP address. It also possible to use the interface name (iface.net_ifacename) or MAC address (iface.hwaddress)

Showing iSCSI interface settings

Use iscsiadm -m iface -I iface0 -o show to show information about an interface (iface0 in this case).

Deleting an existing iSCSI interface

iscsiadm -m iface -I iface0 -o delete

Set up iSCSI target discovery

add iSCSI discovery target

Use the sendtargets method discover targets on, using the configured username / password:

iscsiadm -m discovery -t sendtargets -p -I iface0

show iSCSI discovery settings

iscsiadm -m discovery -p

remove iSCSI discovery target

To disable discovery for the target, use: iscsiadm -m discovery -o delete -p

Connecting to iSCSI target disks

-- Ivo van Geel - 30 Dec 2011

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | More topic actions
Topic revision: r3 - 15 Jul 2017 - IvoVanGeel
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 2010-2019 by LANIS