freenas iscsi – How to activate iscsi in freenas

Freenas ISCSI

[aartikel]1847194680:left:infofreund-21[/aartikel]Hi all, today i want you to show, how you can setup an iscsi-target in freenas.  With an iscsi-target you can provide a cheap shared storage for your clients.

A more technical explanation from http://searchwindowsserver.techtarget.com/

"An iSCSI target is a storage resource located on an Internet Small Computer System Interface (iSCSI) server. iSCSI is a protocol used to link data storage devices over an IP network infrastructure.  (Also see: IP storage.)"

For this tutorial i used the freenas version 9.2.1.9.

Requirements:

freenas
An unused device (can be a loop device -> here is a tutorial how to create such a device http://infofreund.de/?p=276)

Implementation

1.) After login on the webinterface klick the Services-button.

freenas-iscsi-targets

2. Then enable the iscsi-optin by turning the switcher to on. After that, click on the settings-symbol.

freenas-iscsi-on

3. Now add a portal by selecting the Portals-Tab in the menu bar. Then choose "Add Portal".

freenas-iscsi-portals

4. The comment-box is optional, you can comment the the poral here, but u dont have to. Add the portal by pressing "OK".

freenas-iscsi-add-portal

5. Now we add an initiator by selecting the Intitiators-Tab in the menu bar. Here choose "Add Initiator".

freenas-iscsi-initiators

Check, that "ALL" is set In the "Initiators" and the "Authorized network" field. Press "OK" to Add the initiator.

freenas-iscsi-add-initiator

6. We have to add a device or a file now. In my example i use a device.
    To add a device selecting "Extends" in  the menu, then "Add Extend"

.freenas-iscsi-extents

Now set an extend-name, select "device" as the extend-type and select the device itself.
Press "Ok" for finish this operation.

freenas-iscsi-add-device

7. Now we have to create a iscsi-target. Select "Targets" in the menu-bar, then "Add Target"

freenas-iscsi-targets

Add a target-name, then it is important, that "Portal Group ID" and "Initatior Group ID" is set to "1".
Press "OK" to add the target.

freenas-iscsi-add-target

8. For finishing the setup, we have to connect the target to the extend.
To realize this, please click "Associated Targets" and then "Add Target / Extend"

freenas-iscsi-associated-targets

Then select in the target selection your given targetname and in extend-selection-box your given selection name.

freenas-iscsi-associate-targets

With pressing "OK" you created your freenas iscsi target. Gratiulations :)!

How to check, if it is working?

You can can simply check from a linux-shell, if the freenas iscsi target answers.

1. Open a shell.

2. Type the command: iscsiadm -m discovery -t sendtargets -p 192.168.0.106:3260 in the console.
  (Replace 192.168.0.106 with your ip)

3. You should get a answer: 

192.168.0.106:3260,1 iqn.2011-03.org.example.istgt:mytarget

freenas-iscsi-linux-client-check

Bye Chris

Kommentare sind abgeschaltet.