Note: This guide was written using FreeNAS 11.2
In this guide we will explain how to configure iSCSI device mapping using FreeNAS. This could be very usefull for backups when using XenServer (as SR operation with NFS are very limited with XenServer)
Step one – Enable iSCSI Service
Navigate to services > Enable ISCSI service “start on boot” > click “start now” to start the service
Step two – Create Zvol in an existing Volume(Dataset)
Fill the zvol name & comment box > zvol size in Gib > select any of compression method > select Block size > click on “Add zvol”
Step three – iSCSI configuration
1.Create iSCSI Portal
Navigate Sharing > Block (iSCSI) > Portals > Add portal (The portal may exist if it has already been configured)
2.Create Initiators for iSCSI
Configuring Initiator, To define which systems can connect to this iSCSI
Navigate through Sharing > Block (iSCSI) > Initiators > Add Initiators.
While creating an iSCSI initiator you can leave the keyword “ALL”, this will allow connecting from any clients to this iSCSI share.
Note that it is recommended to set initiator IQN. You can see some examples on how to get the IQN from the client machine here – Xenserver exmaple, CentOS example.
Authorized network: define a network address who will be able to access this share.
3.Create Target for iSCSI
Target is a combination of portals, valid initiators, and authentication methods.
Create a Target by navigating Sharing > Block (iSCSI) > Targets > Add Target, as shown in below image.
Target Name: Select a name for your target
Target Alias: optional user-friendly name
Portal Group ID: select the portal group that you created
Initiator Group ID: select the initiator group id that you created in the previous step.
4. Create Extents
iSCSI targets used to define resources to share with clients. There are two types of extents: device and file
Device extents – virtual storage access to zvols or physical devices like a disk.
File extents – virtual storage access to file.
5. Associate an extent to a target
Sharing > Block (iSCSI) > Associated Targets > Add Target/Extent.
Select the items you have created in the previous steps.
That’s it ! You can use these examples to connect iSCSI devices –