You don’t know what an iSCSI Target is? Well simply an iSCSI Target is the “device” that represents a logical disk volume on an iSCSI Server. If you don’t know what iSCSI is – please read here and come back.
So let’s take the case that you would like to make a harddisk volume available across the network. The best block oriented protocol that you could use (and the best sounding…BUZZWOOOOOOORD!) is iSCSI. So there are some commercial iSCSI Implementations for Windows and there are some iSCSI Implementations for Linux. Today cosrahn implemented a solution based on the Linux iSCSI Enterprise Target Project.
This article will give you a list of things you have to do to get it to work by yourself:
You would need:
a linux server with a kernel version 2.6.11 or later
a free disk volume/partition/block device (even a file)
a direct network connection to the machine that would like to use the iSCSI Target
alternatively you have a iSCSI enabled network switch…quite expensive…
a linux or windows machine that has an iSCSI Initiator installed
The iSCSI Initiator is the client part of the solution. It can either be software (like the Microsoft iSCSI Initiator) or hardware (like the Adaptec 7211C). In our case it’s a complete software solution.
Cosrahn installed a Gentoo Linux with a 22.214.171.124 kernel. That took the most of the setup-time. Then he downloaded the source from the iSCSI Enterprise Target page and compiled and installed it.
Then he edited the config file in /etc/ietd.conf:
# iscsi target configuration
# the password NEEDs to be minimum 12 characters to be standard conform
IncomingUser username longpassword
# 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:
# “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.
# Users, who can access this target
# (no users means anyone can access the target)
IncomingUser username specialtargetpassword
# Logical Unit definition
# You must define one logical unit at least.
# Block devices, regular files, LVM, and RAID can be offered
# to the initiators as a block device.
# in our case /dev/sda4 is a partition without any filesystem.
Lun 0 Path=/dev/sda4,Type=fileio
# Alias name for this target
# various iSCSI parameters
After that we started the iSCSI Target daemon and configured the Windows Client to use the target.
This is the “startup-screen” of the Microsoft iSCSI Initiator.
You can see the node name of the iSCSI client.
Now there’s the Target Tab of the iSCSI Initiator. If you entered the Logon-Information to the iSCSI Server correctly you should see the target that are exported by the iSCSI Enterprise Target daemon. In our case there are two targets available.(despite the configuration above just exports one…just ignore it, you can create as much as you like)
You have the choice to let the iSCSI Initiator reconnect to the Target automatically on boot time and of course you have to authenticate yourself to the target. In this case it’s “username” and “specialtargetpassword”.
After you entered everything correctly the “inactive” flag would become a “connected” flag. Now fire up the Disk Management in the Computer Management MMC-SnapIn.
Voilá! You should now see a Disk with the size of the exported target…Just start using it like any other hard disk. Create a partition and a filesystem.
Simply as it could be. That’s it. There are some more options like the Header/Data digest – which is an option to ensure data integrity. While this surely will increase data security it also will increase the CPU usage when you access the iSCSI drive. In our test a 1.7 Ghz Pentium-M CPU had an utilization of about 35-40 percent whilst the iSCSI server only had about 7 percent. We think that the client has so much utilization because of the quite cheap network interface card (realtek…). In fact the utilization is quite massive if you enable Header/Data digest-