In this article, I am going to share what I learned while working with the IET on RHEL. Because I am fairly stubborn, I persisted that I use the latest IET, which at the time was 0.4.17. The unfortunate part was that I could not find an RPM for that version of IET; I could only find 0.4.15, which is about 2 years old. I wanted the most recent stable version!
The project behind this article was to create a cheap iSCSI SAN for a backup to disk solution. The requirements of the project were foremost price, second were space, and third were performance. Amazingly, or should I say surprisingly, all three requirements were met, and in a short amount of time! In another article I will explain the custom server and the issues I had building a custom server system that could support large (10TB+) disk arrays. On to iSCSI…
Installing RHEL
For those that have installed RHEL, it is a fairly simple process, easy enough for any end user really, with the exception of partitioning if RHEL can’t figure out the correct disk order. Do what you will, however, for this project I installed RHEL with no firewall and disabled SELinux. If you are building a test machine, make sure you have enough space available for an additional partition to be served by IET.
Note: if you have no Internet connection while installing RHEL or you do not want to enter your installation key (subscription code), you may activate the RedHat Network (RHN) connection after you have completed your installation. To do so, from a terminal window, run rhn_register.
Configuring and Preparing RHEL for IET
In order to compile IET, you must configure RHEL with additional applications, another download repository, and kernel development files. First, I would suggest running a “yum update” from a terminal window to update your RHEL. As a side note, all of these commands assume you are root. Be sure to configure network connectivity, especially to the Internet.
Extra Packages for Enterprise Linux (EPEL)
Next, let’s configure RHEL to use an additional download repository, EPEL. From the web browser in RHEL, browse to the following link:
http://fedoraproject.org/wiki/EPEL
Click on 1.1 Getting Started with EPEL, then click on How to use EPEL. Then under the Using EPEL heading, click on the RHEL 5 link which allow you to download an RPM to configure the EPEL on your RHEL.
For those that are unaware, EPEL is a repository that contains considerably more applications ready for installation through “yum” or the GUI package manager. The EPEL project is maintained by Fedora, which is essentially RedHat’s open source Linux.
Installing Development Files
In order to compile IET on your RHEL, you will need the following development files installed. This task is easy as “yum” will do all the work for you. From a terminal window, run the following commands:
“yum install openssl-devel”
“yum install kernel-devel”
“yum install kernel-PAE-devel” (32bit RHEL only)
“yum install gcc”
Although not required, since I am a Windows administrator by trade, I have been rebooting my RHEL server after I completed these updates.
Compile IET
Using your web browser, visit http://iscsitarget.sourceforge.net/ and download the latest version of IET, which at the time of this article is 0.4.17. Once downloaded, extract the files to your Desktop and open a terminal window to that location. Such as /~/Desktop/iscsitarget/.
From the iscsitarget folder in the terminal window, run “make”, verify for success and then run “make install”. Assuming all went well, you should now have the IET installed on your RHEL.
Configure IET
Let’s configure the IET application to serve a partition. Although in this example I will use a SCSI disk device, you can use the LVM to create your own unique disks and serve those through IET.
The configuration is fairly simple, replaced with your favorite editor tool from the terminal window, type “nano /etc/ietd.conf”. Until you feel like diving deeper into the IET world, you will only modify two lines in this file, the Target and Lun lines.
Modify the file to look similar to the following:
Target iqn.2009-07.test:iscsi.disk
Lun 0 Path=/dev/sdb,Type=fileio
You may modify the iSCSI target name, just make sure it follows the iSCSI standard. Additionally, you will need to replace the path statement with the path to your disk. To add more than one Target to the same server, just duplicate those lines, such as:
Target iqn.2009-07.test:iscsi.diska
Lun 0 Path=/dev/sdb,Type=fileio
Target iqn.2009-07.test:iscsi.diskb
Lun 0 Path=/dev/sdc,Type=fileio
Starting IET
As you probably know, in RHEL “services” reside within the /etc/init.d/ directory. Using the following command from a terminal window we will start the iscsitarget service:
/etc/init.d/iscsi-target start
To stop the service, run:
/etc/init.d/iscsi-target stop
Testing IET
For simplistic testing of the iSCSI target connectivity, I would suggest using the Microsoft iSCSI software initiator found at: http://www.microsoft.com/iscsi/. Within the Microsoft iSCSI Initiator, add the IP address of the RHEL server to the discovery list and then refresh the available targets. Once you connect to a target/LUN, you will need to open Disk Management to initialize and/or format the disk.
Depending on the hardware set up, you should see fairly quick speeds. For a simple speed test, copy a large file, such as a 3GB file to the iSCSI disk from the Windows machine. In my tests, using an Adaptec 31605 with 1.5TB Seagate drives, a 3GB file would take around 50 seconds to complete – roughly 1GB / minute.
Auto Start IET
If you want the IET to automatically start at system boot up, use the following commands from a terminal window:
“chkconfig –add iscsi-target”
“chkconfig iscsi-target on”
That is it for now…if you have questions, let me know.
As time progresses, I will update an article with troubleshooting tips I have learned while configuring around 5 of these systems. Additionally, if you are really interested in IET, I would suggest joining the Nabble forum group at: http://www.nabble.com/iSCSI-Enterprise-Target-f4401.html