Resource icon

Fibre Channel on FreeNAS 11.1u4

There are a few cobbled guides for setting up fibre channel LUNs from version 9.x. I have tested a few things and found one shortcoming on the guides. they leave your LUNs exposed via iSCSI as well as fiber channel. Here I will provide a method for exposing fibre channel LUNs ONLY over fibre channel.

I have tested this using FreeNAS 11.1u4 on a Dell R510. For the fibre channel HBA I used the qlogic qle2564 but any qlogic card using the ISP(4) driver should work exactly the same. If you are wondering if this is stable and "supported" the answer is sort of. This is fully supported and tested in IX Systems TrueNAS products and as TrueNAS and FreeNAS share the same code base it would stand to reason it will be stable but "unsupported". In fact the only reason we don't see the fibre channel options are due to a few flags and a license. That said, this could break any time IX Systems wanted it to.

Once the card is installed in a suitable PCIe slot we will boot up and verify the card was detected and the driver is loaded. This is done in the console or the Shell from the GUI.
Code:
[root@FreeNAS ~]# lspci | grep "ISP"                                                                                               
08:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)                                   
08:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)                                   
09:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)                                   
09:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)

As long as you see the correct number of devices (one per port) you are set to move to the next step.

In the GUI we need to add a few tunables to ensure the fibre ports are running in target mode or role. This may not be necessary for all cards depending on how they have been configured but there is no harm is setting the hints in any case. The tunables we will be adding need to be set for each port on the card starting from 0 in hint.isp.0.role and counting up one per port.
Variable: hint.isp.0.role
Value: 0
Type: Loader
Comment: target mode FC port 1
Enabled: checked
You can set the comment to anything you like. This is just a reminder for me.

Next we will add a new task to enable the ports. this will be a post init task as we need the driver up and running and the ports set the the correct role. Only one command is needed for all ports.
Type: Command
Command: ctladm port -o on -t fc
When: Post Init
Enable: checked

(At this point I am assuming that you have your file or vdev backing setup and ready for configuration)

In the GUI we need to enable the iSCSI service. This actual enables ctld, the backend for configuring and sharing LUNs.
Once iSCSI is enabled we can start configuring the LUNs. Next I'll cover each tab of the iSCSI configuration page.

  • On the first tab, Target Global Configuration, the only value that matters is the Pool Available Space Threshold and this only applies to vdev backed LUNs. This should be set to no more than 80% (Default).
  • The second tab, Portals, is only relevant to the setup due to limitations in the GUI. Here you need to add a portal and add a comment to the effect of "delete me later" so you know this is safe to remove later. Keeping all other defaults, save the new portal.
  • The third and fourth tab, Initiators and Authorized Access do not apply to the fibre channel configuration.
  • The fifth tab, Targets, are where we set up out targets. This is not the LUN but where the LUN is located. In small environments it makes little difference if you add a target per LUN or just one Target with many LUNs. Add a target with a name of your choosing and select the portal we created in the fist tab.
  • On the sixth tab, Extents, we will add our LUNs. There are a number of important things to mention here. As I work primarily with ESXi, I can share a few pointers for those environments.

  1. The Logical block size MUST be 512. The partitioning utility included in busybox on ESXi cannot handle other sector sizes.
  2. Make note of the serial number! If this changes, for example if you delete and recreate an extent it will get a new serial number and ESXi wil detect you VMFS as a snapshot datastore. This can cause a big mess where all of your VMs are unreachable (on storage) and must be re added one at a time getting new UIDs in the vCenter database meaning vCenter thinks its copied/moved VM blah blah blah. Just make note of your extent serial numbers. Once you have you LUNs added, we can tell ctld.. err FreeNAS what LUNs belong to what targets.

  • The last tab, Target/Extents, is where it all get linked together. Simply add a new target/extent and select your target and your extent. If you leave the LUN number at 0, FreeNAS will automatically assign one. Some applications are sensitive to LUN number changes and it may be advisable to manually enter a number.
  • Now you can go back to the second tab, Portals, and delete the portal you created. This will ensure that no iSCSI connections can be made to your LUNs.
The last step is to reboot. This will allow your loader tunables and post init task to take effect.
Author
kdragon75
Views
23,467
First release
Last update
Rating
5.00 star(s) 2 ratings

Latest reviews

Seriously, I consider myself very capable with FreeNAS but the fibre channel was one of those projects that has kicked my technical ass for a while. This was perfect! Thank you very, very much.
kdragon75
kdragon75
Thanks! I'm glad it helped.
provides steps, commands, and examples. Could be followed by someone not familiar with the subject and implemented correctly
Top