The iSCSI protocol is a storage area network (SAN) protocol which allows iSCSI initiators to use storage devices on the (remote) iSCSI target using normal ethernet cabling. To the iSCSI initiator, the remote storage looks like a normal, locally-attached hard drive.
server1.example.com (Initiator): IP address 192.168.1.100
server2.example.com (Target): IP address 192.168.1.101
Setting up the target [server2]
Installing the software
Modify the config file for iscsitarget
apt-get install iscsitarget
Now enable the ISCSITARGET
NOTE: You can use logical volumes, image files, hard drives [/dev/sdb], partitions [/dev/sdb1] or RAID devices [/dev/md0] for storage.
I am going to use the entire 160GB HDD for iSCSI located at sdb1
Make sure everything is commented out except what is below
NOTE: The target name must be a globally unique name, the iSCSI standard defines the "iSCSI Qualified Name" as follows: iqn.yyyy-mm.
Target iqn.2001-04.com.example:storage.lun1 # Users, who can access this target. The same rules as for discovery # users apply here. # Leave them alone if you don't want to use authentication. IncomingUser OutgoingUser # 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. Lun 0 Path=/dev/sdb,Type=fileio # Alias name for this target Alias LUN1
Now you can limit the access by IP address
Add this into the editor
Now start the service
I will post an article about connecting to the target from another Linux, Mac or Windows Host in the near future. From VMware ESXi and vSphere 4 just add the vKernel and then in the administration section for storage just type in the IP address of the target. I installed 4 VM Guests on vSphere to test and it worked great.