For those of you who have read my previous posts about clustering in VMware with iSCSI, you know I have used Windows implementations of iSCSI target software. In the first post, Creating a cluster in VMware Workstation using iSCSI, I talked about StarWind and StarPort. In a second post, Update: MSCS cluster in VMware using iSCSI, I recommended to replace StarPort with Microsoft’s iSCSI software initiator, which is fully supported in a clustering scenario.

In those earlier posts, I used StarWind. An alternative to StarWind is WinTarget, from String Bean Software. String Bean Software has recently been acquired by Microsoft. Both solutions work well but I wanted to implement an iSCSI target with non-commercial software. The iSCSI target server needed to be portable and not consume too much memory.

To implement this iSCSI target server, I used iSCSI Enterprise Target (IET). IET requires Linux. The next sections describe how to implement and use this solution.

Install Fedora Core 5 in a virtual machine
I wanted my iSCSI target server to be portable, so I implemented it in a virtual machine. Because I will only use the solution for testing, creating installation procedures etc… speed is not important. Because the last version of IET requires a kernel version of 2.6.14 or higher, I decided to use Fedora Core 5 as the iSCSI target server. Here are the installation steps (in short):

  • Download FC 5 from http://fedora.redhat.com/. I downloaded the DVD.
  • Create a new virtual machine in VMware. I configured the virtual machine with 64MB of RAM and one SCSI disk for booting. In VMware, when the OS needs to be selected, select Other Linux 2.6.x kernel.
  • Connect the FC 5 DVD iso to the virtual machine’s CDROM device, start the virtual machine and perform the installation.
  • Once you have FC 5 installed, logon as root.

Update the kernel and install kernel sources
To update the kernel to the latest version, make sure you have an Internet connection and issue the following command as root:

yum update kernel kernel-devel

The command updated my kernel (at the time of this writing) to version 2.6.16.

Next, download the kernel sources. First, determine the complete name with:

uname -r

In my case, the result of the above command was: 2.6.16–1.2080_FC5.

Install the kernel sources with the following command:

yum install kernel-devel-2.6.16-1.2080_FC5

The above command will download and install kernel source files in /usr/src/kernels/2.6.16-1.2080_FC5-i686.

Download and compile iSCSI Enterprise Target
To download the software from the command line, use the following command:

wget http://belnet.dl.sourceforge.net/sourceforge/iscsitarget/iscsitarget-0.4.13.tar.gz

Now, you have the software, time to compile and install it. Use the following commands (from the directory where you downloaded the software):

tar xvfz iscsitarget-0.4.13.tar.gz
cd iscsitarget-0.4.13
export KERNELSRC=/usr/src/kernels/2.6.16-1.2080_FC5-i686
make && make install
Under your current folder (iscitarget-0.4.13) there is a folder etc with a sample configuration file: ietd.conf. That file needs to be copied to /etc.
Use the following command:
cp etc/ietd.conf /etc

At this point, IET is on your system but not started yet. It is also not configured to start automatically. We will do that later.

Creating disks to export and modifying ietd.conf
With IET, you can use regular disks or files as iSCSI volumes. Because we are running the iSCSI target as a virtual machine, providing additional disks is just a matter of shutting down the virtual machine and adding extra disks. I configured my virtual machine with two extra SCSI disks.
Extra_disks
Above, you can see that two extra disks have been added: SCSI 0:1 and SCSI 0:2. We will make these extra disks available over iSCSI. To do this, boot the virtual machine and logon as root. Then issue the following command:
fdisk -l
This lists all the disks the system sees. The two extra SCSI disks should be seen as /dev/sdb and /dev/sdc.Now we need to modify /etc/ietd.conf. My file looks like this:
Target iqn.2001-04.local.geba:storage.disk1
        Lun 0 Path=/dev/sdb
        Lun 1 Path=/dev/sdc
        # Alias name for this target
        Alias iSCSI
        MaxConnections          8
        InitialR2T              Yes

The file needs to contain the name for a target (mine is badly chosen) and under that, you define the LUNs that are offered.
Here, two LUNs are offered. It is clear to see that the device names you found with fdisk -l are used for each LUN.

Starting IET and configuring IET to start at boot
To start IET, use the following command:

/etc/init.d/iscsi-target start

To start IET at boot, use:

chkconfig iscsi-target on

Some fine-tuning
If you installed FC 5 with the firewall turned on, you will have to allow traffic on TCP port 3260. You can easily do this from the command prompt with the setup command.

To allow incoming traffic on 3260:

  • At the command prompt, type setup.
  • Select Firewall Configuration.
  • Select Customize.
  • In Other Ports, type 3260.
  • Select OK twice and then exit the setup tool.

Since there is no need to boot into X, change the default runlevel from 5 to 3 in /etc/inittab. Find a line that reads: id:5:initdefault: and change the 5 into a 3.

Now reboot the system with shutdown -r now and check if IET comes up correctly.

Using the iSCSI target from Windows
To use the LUNs offered by the iSCSI target you just created, use Microsoft’s iSCSI software initiator. Download the software from the Microsoft site and install it.

Then start the configuration tool and, in the Discovery tab, add the FC 5 server. If the server can be reached and port 3260 is open, this should succeed.

Iscsi-discover

Now, go to the Targets tab. You should see the target you configured in the ietd.conf file. Click it and then click Log On. Log on to the target. You should see:

Iscsi-target

You can now click the Details button. In the properties of the target, you should see that this target offers two devices:

 Iscsi-devices

When you go to the disk manager in Windows, you will see the disks. You can now create partitions, format etc… For example (after formatting etc…):

 Disk

In the above screenshot, the two iSCSI disks are Q: and R:.

Using the iSCSI disks in a cluster
You should take a look here first, before setting up an MSCS cluster with iSCSI. As it turns out, setting up an eight-node cluster with the iSCSI software initiator 2.0 and higher is supported. So if you have enough resources, you can setup an eight-node cluster on your laptop with VMware Workstation.

What you need to do in the iSCSI initiator configuration is using persistent bindings and set “Bind Volumes”.

I will not go through the procedure here to create an MSCS cluster. Suffice to say that I tested this solution by building a three-node cluster on my laptop. The laptop runs Windows Server 2003 and VMware Server. Here is a screenshot of the cluster administrator:

Cluadmin

Conslusion
By using free iSCSI target software, you can now setup your cluster in a box for test and development purposes. You can create clusters with more than two nodes and you can copy the virtual machines around to use the cluster on VMware Workstation, VMware Server or ESX. I hope you liked this article. If you have any questions, please post them as comments.