How to Setup iSCSI Drive Using FreeNAS
[LEFT][CODE]http://www.trainsignaltraining.com/how-to-setup-iscsi-drive-using-freenas/2009-01-19/[/CODE]
I recently wrote an article on how to setup a NAS using the open source FreeNAS software. One of the many features of FreeNAS is the ability to setup an iSCSI drive. [B]iSCSI[/B] stands for [B]Internet SCSI[/B] and allows client machines to send SCSI commands to remote storage servers such as FreeNAS.
This allows you to consolidate your storage drives into a single machine for lower cost per GB and easier maintenance, with the illusion of local disk drives on your client machines. The functionality to use iSCSI drives is built into both Windows Vista and Server 2008 natively. At the higher end you can also use iSCSI for low cost clustering solutions and disaster recovery.
In the past this was usually done using special hardware and Fibre cabling, though with iSCSI you can leverage your existing network infrastructure.
It should be noted that depending on the network load and performance requirements of your servers this can be drastically slower than the dedicated options. For a high performance production application you can still use iSCSI but I would look at setting it up on its own network at 1GB speeds.
[B]How Does iSCSI Work?[/B]
There are two parts to the iSCSI protocol, the first being clients and the second being storage devices.
Clients are called iSCSI initiators and can be configured either using hardware or software solutions. As I mentioned earlier this functionality is already built into Vista and Server 2008, so we will not have to add any software/hardware to these machines.
The storage devices are called iSCSI targets and must be running some type of software/hardware to receive the incoming requests from the iSCSI initiators. Luckily FreeNAS has the ability to create iSCSI drives as part of its core package so I am going to use the FreeNAS server I used in a past demo.
[B]Setup iSCSI Target Drive on FreeNAS Server[/B]
I’m going to use FreeNAS as the iSCSI target, and if you are going to follow along with this demo, it is imperative that you have one setup as well.
If you don’t you can read how to [URL="http://www.trainsignaltraining.com/build-your-own-open-source-nas-device-using-freenas-part-1/2008-12-29/"]setup FreeNAS server[/URL] and then come back to this article for the next steps.
This demo is going to assume that while the hard drives are installed in the server they are NOT added to the FreeNAS interface.
[B]1.[/B] Connect to your FreeNAS server through the WebGUI using your favorite browser. In the top menu select [B]Disks[/B], then click [B]Management[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-001.png[/IMG]
[B]2.[/B] Click on the [B]plus[/B] sign in the lower right corner to add drives.
[URL="http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-002.png"][IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-002.png[/IMG][/URL]
[B]3.[/B] Next to [B]Disk[/B], choose the drive you want to add from the drop down, and if you want enter a description for it next to [B]Description[/B].
I usually leave the rest of the settings at default then click [B]Add[/B].
[URL="http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-003.png"][IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-003.png[/IMG][/URL]
[B]4.[/B] When you go back to the Disk Management screen you will be asked to confirm the addition by clicking on [B]Apply changes[/B], go ahead and do that now.
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-004.png[/IMG]
[B]5.[/B] From the top menu choose [B]Services[/B], then [B]iSCSI Target[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-005.png[/IMG]
[B]6.[/B] Click on the [B]plus[/B] sign in the [B]Extent[/B] area.
[URL="http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-006.png"][IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-006.png[/IMG][/URL]
[B]7.[/B] The [B]Bolded[/B] fields are required, so place a name in the [B]Extent name[/B] field, leave the [B]Type[/B] as [B]Device[/B], and then choose the [B]Device[/B] you want in the dropdown.
You can also enter a note in the comment field for reference. When you have set your options click on [B]Add[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-007.png[/IMG]
[B]8.[/B] When you get back to the iSCSI Target page click on [B]Apply changes[/B].
[URL="http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-008.png"][IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-008.png[/IMG][/URL]
[B]9.[/B] Click on the [B]plus[/B] sign in the [B]Target[/B] area.
[URL="http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-009.png"][IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-009.png[/IMG][/URL]
[B]10.[/B] As before the [B]Bolded[/B] fields are required. Here is a breakdown of the fields:[INDENT] [B]Target name:[/B] Add your own or leave the default
[B]Flags: RW[/B] for Read/Write or [B]RO[/B] for Read Only
[B]Storage:[/B] Will have the extents listed that were setup, choose the one you want to use
[B]Authorized Network:[/B] Enter the IP network that can access this drive. For example if your IP was 192.168.1.100, you would enter [B]192.168.1.0[/B]. Most people will leave the 24 in the dropdown if your subnet mask is 255.255.255.0 [/INDENT]Once you fill in all the info click on [B]Add[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-010.png[/IMG]
[B]11.[/B] Back at the iSCSI target page you need to click on [B]Apply changes[/B] once again.
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-011.png[/IMG]
[B]12.[/B] Now place a check in the box next to [B]Enable[/B] in the top right corner and then click [B]Save and Restart[/B] in the bottom left.
[URL="http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-012.png"][IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-012.png[/IMG][/URL]
The iSCSI Target drive is now setup and ready for use.
[B]Setup iSCSI Initiator on Vista[/B]
Now that the iSCSI target drive is ready, let’s go in and configure our Vista client machine to use it.
[B]1.[/B] Click on the [B]Start[/B] menu and type [B]iSCSI[/B] into the menu bar and hit [B]Enter[/B].
[B]2.[/B] Depending on your settings you may get a UAC warning, go ahead and approve if you do.
[B]3.[/B] If this is the first time you are using iSCSI you will get a warning that the iSCSI service is not running and it is asking if you want to start the service and also have it automatically start with your computer. Go ahead and click [B]Yes[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-014.png[/IMG]
[B]4.[/B] The next window that appears will ask if you want to unblock the Microsoft iSCSI service in Windows Firewall. Click on [B]Yes[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-015.png[/IMG]
[B]5.[/B] When the iSCSI Initiator Properties appears click on the [B]Discovery[/B] tab.
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-016.png[/IMG]
[B]6.[/B] Click on [B]Add Portal…[/B]
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-017.png[/IMG]
[B]7.[/B] Place the IP address of the iSCSI target in the text field labeled [B]IP address or DNS name:[/B] and then click [B]OK[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-018.png[/IMG]
[B]8.[/B] Click on the [B]Targets[/B] tab.
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-019.png[/IMG]
[B]9.[/B] Highlight the target drive listed and click [B]Log on…[/B]
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-020.png[/IMG]
[B]10.[/B] In the next window you can choose to have this connection restored when the computer starts by placing a checkmark next to that option. If you don’t then leave it blank. Either way click [B]Ok[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-021.png[/IMG]
[B]11.[/B] You should now see a status of [B]Connected[/B], confirm that and then click [B]Ok[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-022.png[/IMG]
[B]12.[/B] Click on [B]Start[/B], right click on [B]Computer[/B], then click on [B]Manage[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-023.png[/IMG]
[B]13.[/B] If you get a UAC warning, click through. You will now see the Computer Management MMC, click on [B]Disk Management[/B] and in a few seconds the disks will populate.
[B]Disk 1[/B] is the iSCSI drive and you can see that it shows up unallocated. Right click on the drive and select [B]New Simple Volume[/B].
[B]NOTE:[/B] If the disk drive was formatted previously you might have to Delete partition first.
[URL="http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-024.png"][IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-024.png[/IMG][/URL]
[B]14.[/B] When the New Simple Volume Wizard starts go ahead and click [B]Next[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-025.png[/IMG]
[B]15.[/B] Set the size of the volume you want to create; in this demo I am using all the space. After you set the space click [B]Next[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-026.png[/IMG]
[B]16.[/B] Assign a drive letter, for this demo I am using [B]F[/B]; then click [B]Next[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-027.png[/IMG]
[B]17.[/B] I am going to format this drive as [B]NTFS[/B] and place a check next to [B]Perform a quick format[/B]. You can also assign a volume label, then click [B]Next[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-028.png[/IMG]
[B]18.[/B] Review the settings selected and then click [B]Finish[/B].
[IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-029.png[/IMG]
[B]19.[/B] Depending on the speed of the network and the size of the drive it may take some time to format. When it is finished you will see it ready to go in Disk Management.
[URL="http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-030.png"][IMG]http://www.trainsignaltraining.com/wpnew/wp-content/uploads/2009/01/iscsi-030.png[/IMG][/URL]
[B]Summary[/B]
We have setup a iSCSI target drive in FreeNAS and then setup an iSCSI initiator in Windows Vista to attach to the FreeNAS drive. After that we configured the drive for use on our Vista machine by formatting it and assigning a drive letter.
While not for everyone, iSCSI definitely has its uses and if it is suitable for your environment and needs, FreeNAS provides a low cost alternative
[/LEFT]