(Tutorials) iSCSI

January 29, 2014

Testing iSCSI with 2 Raspberry Pi’s

  1. Important
  2. Setup an initiator (client) on rpi-2
  3. More info with initiator target
  4. Setup target
  5. Setup a target automatically
  6. Setup a target manually
  7. Add LUN
  8. Connect from initiator

rpi-1: target: 192.168.5.31
rpi-2: initiator: 192.168.5.32

Important

Source: https://groups.google.com/forum/#!topic/open-iscsi/iAwrdax-mSA

"open-iscsi is only a initiator. For a target you need something like IET or SCST or tgt, or in RHEL5.3 I think there is scsi-target-utils which is a rpm/package of tgt (you might have to have some sort of special storage/clustering thing with red hat to get it though)."

Setup an initiator (client) on rpi-2

Source: http://elinux.org/RPi_iSCSI_Initiator

More info with initiator <-> target

http://www.howtoforge.com/using-iscsi-on-debian-squeeze-initiator-and-target

Setup target

rpi-1# apt-get install tgt

Start tgt daemon

rpi-1# /usr/sbin/tgtd --iscsi portal=192.168.5.31:3260

You get “error” messages:

librdmacm: couldn't read ABI version. librdmacm: assuming: 4 CMA: unable to get RDMA device list (null): iser_ib_init(3263) Failed to initialize RDMA; load kernel modules? (null): fcoe_init(214) portal=192.168.5.31:3260

These can be safely ignored: we do not do RDMA (see url: http://osdir.com/ml/debian-bugs-dist/2010-09/msg08226.html )
Verify the daemon is running:

rpi-1# netstat -ntulp | grep 3260

Setup a target automatically

rpi-1# tgt-setup-lun -d /dev/loop0 -n my_target 192.168.5.32 Using transport: iscsi Creating new target (name=iqn.2001-04.com.rpi-1-my_target, tid=1) Adding a logical unit (/dev/loop0) to target, tid=1 Accepting connections only from 192.168.5.32

Setup a target manually

rpi-1# tgtadm --lld iscsi --op new --mode target --tid 1 -T \ iqn.2013-11.nl.kwalinux:storage.disk1.rpi-1

The target name must be a globally unique name, the iSCSI standard defines the “iSCSI Qualified Name” as follows:
iqn.yyyy-mm.[:identifier]; yyyy-mm is the date at which the domain is valid; the identifier is freely selectable.

Add LUN

rpi-1# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /storage/disk1 rpi-1# tgtadm --lld iscsi --op show --mode target rpi-1# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

Connect from initiator

rpi-2# iscsiadm --mode discovery --type sendtargets --portal 192.168.5.31 rpi-2# iscsiadm --mode node \ --targetname iqn.2013-11.nl.kwalinux:storage.disk1.rpi-1 \ --portal 192.168.5.31:3260 --login rpi-2# fdisk -l rpi-2# mount /dev/sda1 /mnt

Done!

 
"This email is never sent unsolicited. It is only sent to you because you are lucky enough to know the sender."

Powered by Wordpress. Theme by Shlomi Noach, openark.org
© 2017 KwaLinux Trainingen | Algemene voorwaarden | KvK: 10147727 | Disclaimer