{"id":78,"date":"2011-09-02T15:39:59","date_gmt":"2011-09-02T14:39:59","guid":{"rendered":"http:\/\/www.simweb.ch\/blog\/?p=78"},"modified":"2011-09-19T07:24:11","modified_gmt":"2011-09-19T06:24:11","slug":"nexenta-illumos-as-fc-target-1","status":"publish","type":"post","link":"https:\/\/www.simweb.ch\/blog\/2011\/09\/nexenta-illumos-as-fc-target-1\/","title":{"rendered":"Nexenta \/ illumos as FC target (1)"},"content":{"rendered":"<p>I have been lucky to get some elderly 4 GBit FC\u00a0 hardware step by step from used-hardware resellers for a reasonably low\u00a0 price - this originated in the interest after deploying a iSCSI SAN at work using the OpenSolaris (soon to be <a href=\"http:\/\/www.illumos.org\">illumos<\/a>) based <a href=\"http:\/\/www.nexentastor.org\">NexentaStor<\/a> appliance OS. Thankfully my employer allowed my to install and test the gear at work - because I don't have home similar to\u00a0 <a href=\"http:\/\/blog.tschokko.de\/\">@tschokko<\/a>.<\/p>\n<p>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...).<\/p>\n<p><strong>Preparing the OS:<\/strong><\/p>\n<p>Installing the Nexenta Core OS\u00a0 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. \ud83d\ude09<\/p>\n<p>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):<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">apt-get update\r\napt-get install sunwlibc\r\napt-clone upgrade<\/pre>\n<p>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).<\/p>\n<p><strong>Enabling STMF and switching HBAs to target mode:<\/strong><\/p>\n<pre class=\"brush: actionscript3; gutter: true; first-line: 1\">root@kodama:~# svcadm enable stmf\r\nroot@kodama:~# svcs -v stmf\r\nSTATE          NSTATE        STIME    CTID   FMRI\r\nonline         -             Aug_31        - svc:\/system\/stmf:default<\/pre>\n<p>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<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">root@kodama:~# mdb -k\r\n&gt; ::devbindings -q qlc\r\nffffff03597fe030 pciex1077,2432, instance #0 (driver name: qlc)\r\nffffff03597fb2c0 pciex1077,2432, instance #1 (driver name: qlc)\r\nffffff03597fb038 pciex1077,2432, instance #2 (driver name: qlc)\r\nffffff03597f6ce8 pciex1077,2432, instance #3 (driver name: qlc)\r\n&gt; $q\r\nMore<\/pre>\n<p>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:<\/p>\n<p class=\"brush: bash; gutter: true; first-line: 1\">\/etc\/driver_aliases:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">[...]\r\nqlt \"pciex1077,2432\"\r\nqlc \"pciex1077,2532\"<\/pre>\n<p>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. <a href=\"http:\/\/nexenta.org\/boards\/1\/topics\/2730#message-2733\"><strong>Without this firmware your HBAs will<\/strong><\/a> continue blinking (~ no link) and <a href=\"http:\/\/nexenta.org\/boards\/1\/topics\/2730#message-2733\"><strong>stay unoperational<\/strong><\/a>. If you made things right, you should see something like this:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">root@kodama:~# fcinfo hba-port\r\nHBA Port WWN: 50060b000065566e\r\n        Port Mode: Target\r\n        Port ID: 10000\r\n        OS Device Name: Not Applicable\r\n        Manufacturer: QLogic Corp.\r\n        Model: HPAE311 (-&gt; This is a HP-branded QLE2460)\r\n        Firmware Version: 5.2.1\r\n        FCode\/BIOS Version: N\/A\r\n        Serial Number: not available\r\n        Driver Name: COMSTAR QLT\r\n        Driver Version: 20100505-1.05\r\n        Type: F-port\r\n        State: online\r\n        Supported Speeds: 1Gb 2Gb 4Gb\r\n        Current Speed: 4Gb\r\n        Node WWN: 50060b000065566f\r\nHBA Port WWN: 2100001b321fe743\r\n        Port Mode: Target\r\n        Port ID: 10400\r\n[...]\r\nroot@kodama:~# stmfadm list-target\r\nTarget: wwn.50060B0000655664\r\nTarget: wwn.2101001B323FE743\r\nTarget: wwn.2100001B321FE743\r\nTarget: wwn.50060B000065566E<\/pre>\n<p>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.<\/p>\n<p><a title=\"Nexenta \/ illumos as FC target (2)\" href=\"https:\/\/www.simweb.ch\/blog\/2011\/09\/nexenta-illumos-as-fc-target-2\/\">Next up: Carvin out volumes and do LUN mapping<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been lucky to get some elderly 4 GBit FC\u00a0 hardware step by step from used-hardware resellers for a reasonably low\u00a0 price &#8211; 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 &#8230; <a class=\"moretag\" href=\"https:\/\/www.simweb.ch\/blog\/2011\/09\/nexenta-illumos-as-fc-target-1\/\">more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[13,14,15],"class_list":["post-78","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-comstar","tag-fc","tag-nexenta"],"_links":{"self":[{"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/comments?post=78"}],"version-history":[{"count":0,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}