iSCSI SAN

Storage Area Networks (SANs) are widely used in Enterprise class networks, mainly for setting up shared storage for any type of cluster. Fiber used to be dominant for SAN connectivity. You'd need Fiber Host Bus Adapters (HBAs) in every server you wanted attached to your SAN, and a Fiber switch to connect everything. iSCSI works with much cheaper Network Interface Cards (NICs), and can use regular network switches. Initially iSCSI wasn't as fast as Fiber. Now with 10Gigabit Ethernet being readily available, you can setup iSCSI SANs that are both cost effective and high performance.

One of the many features of FreeNAS is the ability to setup an iSCSI LUNs. iSCSI allows client machines to send SCSI commands to remote storage servers. This allows you to consolidate your storage drives into a single machine with the illusion of local disk drives on your client machines. There are two parts to the iSCSI protocol, the first being clients and the second being storage devices. Clients are called iSCSI initiators  and storage devices are called iSCSI targets that receive the incoming requests from the iSCSI initiators.

With iSCSI the control is low level. So low level in fact, that the disk needs to be partitioned and formatted by the Initiator. When the Initiator wants some data from the network storage it sends the low level commands to read and write data from the different sectors of the disk. The results of those operations are returned by the Target over the network to the Initiator.

Configure iSCSI target

1. Add HDD 20GB to FreeNAS server

2. To configure iSCSI, click ‘Services’ and then then click the small wrench icon next to iSCSI


3. Click Portals on the menu bar at the top of the iSCSI tab. Click Add Portal. Accept the default 0.0.0.0:3260 and click OK

4. Click Initiators -> Add Initiator, accept defaults as ALL and ALL and click OK
 

5. The next step is to create an extent. This will be the hard disk presented to the Initiator. In fact, it is a file on the FreeNAS server which will act as a virtual hard disk. The size of the file created will determine the size of the iSCSI hard disk. Click Extents and Add Extent as given below :

6. When an iSCSI Initiator connects to an iSCSI server it connects to a Target. To create a Target click Targets and Add Target. Enter a Target Name (eg. target1), select Disk from the Type drop down menu. Select 1 for the Portal Group ID and the Initiator Group ID and click OK

7. Finally the Target needs to be associated with the Extent so that when the iSCSI Initiator connects to the target it uses the corresponding extent. Click Associated Targets and Add Target/ Extent. Select target1 from the Target drop down list and extent1 from the Extent drop down list. Click OK

8. Now the virtual SAN has been configured and we have iSCSI LUN with LUN ID 0

9. To enable the iSCSI service, click Services and click the iSCSI Off switch to make it go from “Off” to “On”

Configure iSCSI initiator

1. Click iSCSI initiator, enter target IP of FreeNAS server and click quick connect

2. Select the target1 and click connect and now you can see the status as connected

3. Windows is now connected to the iSCSI drive (which is really a file based extent on the FreeNAS server). To use the drive start the Disk Management program by typing diskmgmt.msc in the search box of the Start Menu and click diskmgmt.msc. The first time the Disk Management program starts it will detect the uninitialized iSCSI drive and prepare to initialize it. Click OK

4. The disk will then become available as Unallocated partition and click New Simple Volume. Go through the “New Simple Volume Wizard” accepting the defaults.

5. Once the format is complete the drive will appear just like any other hard drive in Windows Explorer