ISCSI SAN’s are on the rise and a number of data centers are installing them. The cost for a good iSCSI SAN is not expensive in comparison to a fiber channel (FC) SAN and will give you almost the exact performance. There are a number of applications out there that also need a SAN (FC or iSCSI) backend. If you are looking at virtualization (VMware to Hyper-V) then a backend SAN is a must.
I was recently involved in a project to get VMWare ESX server up an running. One of the large costs to that project was the SAN (we used iSCSI). Now, as I was unpacking our $60,000.00 plus iSCSI SAN, I thought that FreeBSD should be able to do this. FreeBSD has always come through for me before and this sounded like a good fit. I did some research and it looks like it can. There is an iSCSI port that will allow a FreeBSD server to act as an iSCSI SAN. This article is my explination on how I set it up for testing.
Installing the Port
# cd /usr/ports/net/iscsi-target
# make install
# make clean
Configuring the iSCSI targets
An iSCSI target is the storage that will be presented to the iSCSI initiators. In non iSCSI speak, an initiator is the software that runs on the client computers and allows you to map a drive from the SAN. This section shows how to setup the targets that get presented to the client. Each target is made up of an extent, device (optional), and a target. In this example I will setup two targets. One that is a local file on the FreeBSD box and the other that is a raw disk.
# cd /usr/local/etc/iscsi
# vi targets
Create the following targets file:
# Simple file showing 2 extents, mapped into 2 targets
# extents file start length
extent0 /usr/local/iSCSI/iscsi-target0 0 15GB
extent1 /dev/da2 0 30GB
# target flags storage netmask
target0 rw extent0 10.0.0.0/8
target1 rw extent1 10.0.0.0/8
This file will creates two different targets for testing. One will be using a file as the back end and the other is a raw disk. The network paramater also controls who can see this target on the network.
Starting the iSCSI Daemon
# echo iscsi_target_enable=\”YES\” >> /etc/rc.conf
# /usr/local/etc/c.d/iscsi_target start