Fedora 23
Sponsored Link

Configure iSCSI Target2015/11/05

Configure Storage Server with iSCSI.
A storage on a network is called iSCSI Target, a Client which connects to iSCSI Target is called iSCSI Initiator. This example is based on the environment below.
+----------------------+          |          +----------------------+
| [   iSCSI Target   ] | || [ iSCSI Initiator  ] |
|     dlp.srv.world    +----------+----------+     www.srv.world    |
|                      |                     |                      |
+----------------------+                     +----------------------+

[1] Install administration tools first.
[root@dlp ~]#
dnf -y install targetcli
[2] Configure iSCSI Target.
For example, create an disk-image under the /iscsi_disks directory and set it as a SCSI device.
# create a directory

[root@dlp ~]#
mkdir /iscsi_disks

# enter the admin console

[root@dlp ~]#

targetcli shell version 2.1.fb41
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

cd backstores/fileio
# create a disk-image with the name "disk01" on /iscsi_disks/disk01.img with 20G

create disk01 /iscsi_disks/disk01.img 20G

Created fileio disk01 with size 21474836480
cd /iscsi
# create a target

create iqn.2015-11.world.srv:storage.target00

Created target iqn.2015-11.world.srv:storage.target00.
Created TPG 1.
Global pref auto_add_default_portal=true
Created default portal listening on all IPs (, port 3260.
cd iqn.2015-11.world.srv:storage.target00/tpg1/luns
# set LUN

create /backstores/fileio/disk01

Created LUN 0.
cd ../acls
# set ACL (it's the IQN of an initiator you permit to connect)

create iqn.2015-11.world.srv:www.srv.world

Created Node ACL for iqn.2015-11.world.srv:www.srv.world:www.srv.world
Created mapped LUN 0.
cd iqn.2015-11.world.srv:www.srv.world
# set UserID for authentication

set auth userid=username

Parameter userid is now 'username'.
set auth password=password

Parameter password is now 'password'.

Global pref auto_save_on_exit=true
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json
# after configuration above, the target enters in listening like follows

[root@dlp ~]#
ss -napt | grep 3260

LISTEN     0      256                       *:3260                     *:*
Matched Content