From Fedora Project Wiki

Revision as of 17:54, 11 February 2009 by Jlaska (talk | contribs) (Added mganisin's loop back instructions and start fleshing out common functions)

About

This page is intended to outline a series of steps need to quickly get a scsi-target-utils based iSCSI software target working.

Most of these instructions can also be found in a README provided by the scsi-target-utils package (see /usr/share/doc/scsi-target-utils-0.9.2/README.iscsi).

Installation

Start by installing the scsi-target-utils package.

# yum install scsi-target-utils

Configuration

Firewall

Ensure, port 3260 is available for incoming connection and there is no firewall in the way between target and test machine.

  • Either stop your firewall:
    # service iptables stop
  • Or, open up port 3260 for traffic using:
    # system-config-firewall
  • Or, modify your iptables configuration manually by
    1. editing /etc/sysconfig/iptables
    2. Then restarting iptables:
      # service iptables restart

Backing Store

When configured, the tgtd service will present a block device to iSCSI initiators. You may use a LVM logical volume, a disk partition, a whole disk, or a loop back partition. For this document, we will create a /dev/loop0 loop back device.

  1. First, create a 8Gib file:
    # dd if=/dev/zero of=/tmp/iscsi-disk1 bs=1M count=8000
  2. Next, create a loopback device:
    # losetup /dev/loop0 /tmp/iscsi-disk1

Selinux

FIXME - detail any selinux considerations on the target.

Service startup

Configure the tgtd service to start on boot. Type:

# service tgtd start
# chkconfig tgtd on

How to ...

The following sections detail common actions you might perform using the tgtadm utility with the configuration used above.

List active targets

At any time you can list the active targets by typing:

# tgtadm --lld iscsi --op show --mode target