I have been lucky to get some elderly 4 GBit FC hardware step by step from used-hardware resellers for a reasonably low price - this originated in the interest after deploying a iSCSI SAN at work using the OpenSolaris (soon to be illumos) based NexentaStor appliance OS. Thankfully my employer allowed my to install and test the gear at work - because I don't have home similar to @tschokko.
Since the free-as-in-beer Community Edition doesn't allow managing FC target other than via native OS shell, I went with Nexenta Core 3, which is their free-as-in-speech distribution of OpenSolaris snv134 + a ton of patches from later ONNV and illumos.- I chose it because I wanted to have the most similar kernel to what is used in the commercial edition. In this series I'd like wrap up how I how I went the ride (i.e. self-documentation...).
Preparing the OS:
Installing the Nexenta Core OS is pretty much straightforward if your hardware is supported I won't comment on that besides that you should give a static IP since if you are not a daily Solaris admin, you will have to do more googling how you have to disable NWAM and do manual config. 😉
After installation of NexentaOS 3.0.1 I'd recommend you to upgrade to the latest bits, but before that you should install sunwlibc because without this, the STMF won't run (mostly equivalent what went into NexentaStor 3.1.1 curently):
apt-get update apt-get install sunwlibc apt-clone upgrade
You can then reboot into the clone of the updated OS, the original Kernel in 3.0.1 has a couple bugs that were squashed later on - but most importantly you will get the latest open source ZFS file system (v5) and pool version (v28).
Enabling STMF and switching HBAs to target mode:
root@kodama:~# svcadm enable stmf root@kodama:~# svcs -v stmf STATE NSTATE STIME CTID FMRI online - Aug_31 - svc:/system/stmf:default
Afterwards we have to switch HBAs into target mode - assuming you have 4G or 8G FC HBA this the driver we need is called 'qlt'. - There is also a driver for Emulex HBAs where things are a bit different. Important side
root@kodama:~# mdb -k > ::devbindings -q qlc ffffff03597fe030 pciex1077,2432, instance #0 (driver name: qlc) ffffff03597fb2c0 pciex1077,2432, instance #1 (driver name: qlc) ffffff03597fb038 pciex1077,2432, instance #2 (driver name: qlc) ffffff03597f6ce8 pciex1077,2432, instance #3 (driver name: qlc) > $q More
You can use a command to tell the OS not using qlc but qlt - but you can also edit the /etc/driver_aliases and replace the occurence of qlc where pxiex1077 appears:
[...] qlt "pciex1077,2432" qlc "pciex1077,2532"
After you have done this you will have to reboot the system for a last time. Enabling STMF (SCSI Target Mode Framework) is important since it will handle the upload of a Qlogic target mode firmware on all your HBAs. Without this firmware your HBAs will continue blinking (~ no link) and stay unoperational. If you made things right, you should see something like this:
root@kodama:~# fcinfo hba-port HBA Port WWN: 50060b000065566e Port Mode: Target Port ID: 10000 OS Device Name: Not Applicable Manufacturer: QLogic Corp. Model: HPAE311 (-> This is a HP-branded QLE2460) Firmware Version: 5.2.1 FCode/BIOS Version: N/A Serial Number: not available Driver Name: COMSTAR QLT Driver Version: 20100505-1.05 Type: F-port State: online Supported Speeds: 1Gb 2Gb 4Gb Current Speed: 4Gb Node WWN: 50060b000065566f HBA Port WWN: 2100001b321fe743 Port Mode: Target Port ID: 10400 [...] root@kodama:~# stmfadm list-target Target: wwn.50060B0000655664 Target: wwn.2101001B323FE743 Target: wwn.2100001B321FE743 Target: wwn.50060B000065566E
Congratulations you have a working fibre channel target box - You might also re-do the same mdb -k command and search for devbindings of qlt and qlc.