InstallingiSCSIEnterpriseTarget

How to install iSCSI Enterprise Target

It's important to note that iSCSI Enterprise Target is a software package that is not available in the Ubuntu repositories at this time. So these instructions will lead you through the process of acquiring external source code and installing this software package on a base Ubuntu 7.04 Server.

Prerequisites

Installation

  1. First install all of the supporting software packages.
    •    $ sudo apt-get install build-essential libssl-dev linux-headers-`uname -r` 
  2. Next untar/ungzip the iscsi-target source code.
    •    $ tar xvfz iscsitarget-0.4.15.tar.gz 
  3. Build the software and kernel modules.
    •    $ cd iscsitarget-0.4.15/
         $ make 
  4. Install the userland programs and linux kernel modules.
    •    $ make install 
  5. The default init script references /bin/sh but uses ksh syntax. We need to modify the script to use the default shell that does support ksh syntax, bash.
    •    $ sudo vi /etc/init.d/iscsi-target 
      We need to make the following modification to this file.
        Original
        ---------------
         #!/bin/sh
         #
         # chkconfig: - 39 35
         # description: Starts and stops the iSCSI target
         # debianized start-stop script
         [...]
        Modified
        ---------------
         #!/bin/bash
         #
         # chkconfig: - 39 35
         # description: Starts and stops the iSCSI target
         # debianized start-stop script
         [...]

Configuration

  1. Edit the ietd.conf file
    • Not all of the example targets are commented out, make certain that they are commented out before you save this file, as they will interfere with our configuration.
          $ sudo vi /etc/ietd.conf 
      This is our example ietd.conf file. It defines the authentication for our initiator, and the target in which the initatiator can reach.
          # IncomingUser sets the username and password the iSCSI initiator needs to 
          # provide to access the Luns below.  The password must be atleast 12 but smaller 
          # than 16 characters long to be compliant with the Microsoft iSCSI initiator.
          IncomingUser patrick abcdefghijklmnop
      
          # OutgoingUser sets the username and password the iSCSI target needs to provide to the initiator.
          OutgoingUser patrick abcdefghijklmnop
      
          # Targets definitions start with "Target" and the target name.
          # The target name must be a globally unique name, the iSCSI
          # standard defines the "iSCSI Qualified Name" as follows:
          #
          # iqn.yyyy-mm.<reversed domain name>[:identifier]
          #
          # "yyyy-mm" is the date at which the domain is valid and the identifier
          # is freely selectable. For further details please check the iSCSI spec.
      
          # Lun sets the Lun device number (which needs to be unique per each server, 
          # the Path to the file or block device representing the iSCSI device, and the
          # Type of access required (This should almost always be set to fileio).
          Target iqn.2007-12.com.example:disk0
              Lun 0 Path=/tmp/disk0,Type=fileio
  2. Create a 500MB file to represent our newly configured lun. The size you set with this dd command will determine how large the lun appears to the iSCSI initiator.
    •    $ sudo dd if=/dev/zero of=/tmp/disk0 bs=1M count=500 
  3. Start the iSCSI Enterprise Target daemon.
    •    $ sudo /etc/init.d/iscsi-target start 

Where to go from here

Now that you have completed the installation and configuration, where do you go from here? I would suggest reading the following articles.

InstallingiSCSIEnterpriseTarget (last edited 2008-08-06 16:20:09 by localhost)