{"id":81,"date":"2011-09-04T10:03:01","date_gmt":"2011-09-04T09:03:01","guid":{"rendered":"http:\/\/www.simweb.ch\/blog\/?p=81"},"modified":"2012-02-12T16:54:08","modified_gmt":"2012-02-12T15:54:08","slug":"nexenta-illumos-as-fc-target-2","status":"publish","type":"post","link":"https:\/\/www.simweb.ch\/blog\/2011\/09\/nexenta-illumos-as-fc-target-2\/","title":{"rendered":"Nexenta \/ illumos as FC target (2)"},"content":{"rendered":"<p>The<a title=\"Nexenta \/ illumos as FC target (1)\" href=\"https:\/\/www.simweb.ch\/blog\/2011\/09\/nexenta-illumos-as-fc-target-1\/\"> first articl<\/a>e was a bit specific on <a title=\"NexentaOS - the Core OS powering NexentaStor\" href=\"http:\/\/www.nexenta.org\/\">NexentaOS<\/a> 3.x bust most of the things I'll write here can be used (currently) 1:1 on <a title=\"The spiritual successor of OpenSolaris\" href=\"http:\/\/www.openindiana.org\">OpenIndiana<\/a> and <a title=\"The Joyent-driven SmartOS Project\" href=\"http:\/\/smartos.org\">SmartOS<\/a>\u00a0 Live (once you get it installed on Disk). I'd not recommend using the UNIX shell within NexentaStor, the Appliance OS that comes with a Storage Management System (NMS) and its respective Shell tools (NMC) and Web-UI (NMV), you risk messing up to management interface temporarily.<\/p>\n<p>At this point I expect you that have configured basic zoning on your FC switches. Actually I simply created a zone for each virtualization node and its targets node containing respective <a href=\"http:\/\/en.wikipedia.org\/wiki\/World_Wide_Name\">WWN<\/a> of these Ports\u00a0 (I did not make Zones on port basis). - Maybe I'll wrap up the story of updating my Silkworms 200E's from FabOS 5.1 to 6.2 \ud83d\ude09<\/p>\n<p>OK, let's enumerate the disks and create a pool:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">root@kodama:~# format\r\nSearching for disks...done\r\n\r\nAVAILABLE DISK SELECTIONS:\r\n 0. c0t10d0 &lt;DEFAULT cyl 4497 alt 2 hd 255 sec 63&gt;\r\n \/pci@0,0\/pci8086,25f7@2\/pci8086,3500@0\/pci8086,3514@1\/pci8086,3478@0\/sd@a,0\r\n 1. c0t12d0 &lt;SEAGATE-ST3300656SS-0005 cyl 22465 alt 2 hd 6 sec 636&gt;\r\n \/pci@0,0\/pci8086,25f7@2\/pci8086,3500@0\/pci8086,3514@1\/pci8086,3478@0\/sd@c,0\r\n 2. c0t13d0 &lt;SEAGATE-ST3146855SS-0001-136.73GB&gt;\r\n \/pci@0,0\/pci8086,25f7@2\/pci8086,3500@0\/pci8086,3514@1\/pci8086,3478@0\/sd@d,0\r\n 3. c0t14d0 &lt;SEAGATE-ST3146356SS-0006-136.73GB&gt;\r\n \/pci@0,0\/pci8086,25f7@2\/pci8086,3500@0\/pci8086,3514@1\/pci8086,3478@0\/sd@e,0\r\n 4. c0t15d0 &lt;SEAGATE-ST3146855SS-0001-136.73GB&gt;\r\n \/pci@0,0\/pci8086,25f7@2\/pci8086,3500@0\/pci8086,3514@1\/pci8086,3478@0\/sd@f,0\r\n 5. c0t19d0 &lt;SEAGATE-ST3300655SS-0001-279.40GB&gt;\r\n \/pci@0,0\/pci8086,25f7@2\/pci8086,3500@0\/pci8086,3514@1\/pci8086,3478@0\/sd@13,0\r\n 6. c0t20d0 &lt;SEAGATE-ST3300655SS-0001-279.40GB&gt;\r\n \/pci@0,0\/pci8086,25f7@2\/pci8086,3500@0\/pci8086,3514@1\/pci8086,3478@0\/sd@14,0\r\n 7. c0t21d0 &lt;SEAGATE-ST3300655SS-0001-279.40GB&gt;\r\n \/pci@0,0\/pci8086,25f7@2\/pci8086,3500@0\/pci8086,3514@1\/pci8086,3478@0\/sd@15,0\r\n 8. c0t22d0 &lt;SEAGATE-ST3300655SS-0001-279.40GB&gt;\r\n \/pci@0,0\/pci8086,25f7@2\/pci8086,3500@0\/pci8086,3514@1\/pci8086,3478@0\/sd@16,0\r\nSpecify disk (enter its number): ^C<\/pre>\n<pre class=\"brush: bash; gutter: true; first-line: 1\"># zpool create sasmirror1 mirror c0t19d0 c0t20d0 mirror c0t21d0 c0t22d0 spare c0t12d0<\/pre>\n<p class=\"brush: bash; gutter: true; first-line: 1\">Now we can see our newly created pool and start carving out Volumes (\"zVols\")<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\"># zpool list\r\nNAME\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 SIZE\u00a0 ALLOC\u00a0\u00a0 FREE\u00a0\u00a0\u00a0 CAP\u00a0 DEDUP\u00a0 HEALTH\u00a0 ALTROOT\r\nsasmirror1\u00a0\u00a0\u00a0\u00a0 556G\u00a0\u00a0 249K\u00a0\u00a0 556G\u00a0\u00a0\u00a0\u00a0 0%\u00a0 1.00x\u00a0 ONLINE\u00a0 -\r\nsyspool\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 34.2G\u00a0 9.17G\u00a0 25.1G\u00a0\u00a0\u00a0 26%\u00a0 1.00x\u00a0 ONLINE\u00a0 -\r\n\r\n# zpool status sasmirror1\r\n\u00a0 pool: sasmirror1\r\n\u00a0state: ONLINE\r\n\u00a0scan: scrub repaired 0 in 0h0m with 0 errors on Wed Aug 31 13:06:45 2011\r\nconfig:\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NAME\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 STATE\u00a0\u00a0\u00a0\u00a0 READ WRITE CKSUM\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sasmirror1\u00a0\u00a0 ONLINE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mirror-0\u00a0\u00a0 ONLINE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 c0t19d0\u00a0 ONLINE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 c0t20d0\u00a0 ONLINE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mirror-1\u00a0\u00a0 ONLINE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 c0t21d0\u00a0 ONLINE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 c0t22d0\u00a0 ONLINE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0 0\r\n        spares\r\n          c0t12d0    AVAIL   \r\n\r\nerrors: No known data errors<\/pre>\n<p class=\"brush: bash; gutter: true; first-line: 1\">After creating a data pool we can start carving out ZFS volumes (zVol):<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\"># zfs create -V 20G sasmirror1\/akebono-scratchvol\r\n# zfs list\r\nNAME                            USED  AVAIL  REFER  MOUNTPOINT\r\nsasmirror1                      433G   114G    31K  \/sasmirror1\r\nsasmirror1\/akebono-scratchvol  20.6G   135G    16K  -\r\nsyspool                        10.2G  23.5G  36.5K  legacy\r\nsyspool\/dump                   7.00G  23.5G  7.00G  -\r\nsyspool\/rootfs-nmu-000         1.46G  23.5G  1.03G  legacy\r\n[...]<\/pre>\n<p class=\"brush: bash; gutter: true; first-line: 1\"><strong>sbdadm - SCSI block device administration CLI<\/strong><\/p>\n<p class=\"brush: bash; gutter: true; first-line: 1\">Albeit we have our zVol available we have to tell STMF that this is a volume that can be mapped as a LUN, this is why sbdadm is here:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\"># sbdadm create-lu \/dev\/zvol\/rdsk\/sasmirror1\/akebono-scratchvol\r\nCreated the following LU:\r\n\r\n              GUID                    DATA SIZE           SOURCE\r\n--------------------------------  -------------------  ----------------\r\n600144f098680b0000004e632dc60004  21474836480          \/dev\/zvol\/rdsk\/sasmirror1\/akebono-scratchvol<\/pre>\n<p class=\"brush: bash; gutter: true; first-line: 1\">(Update 2012: You can also use stmfadm to create a LUN, it's up to you what you want to use, I think the output of sbdadm is still better)<\/p>\n<p class=\"brush: bash; gutter: true; first-line: 1\">At this point I'ld like to remember the flexibility the original engineers at Sun added into into\u00a0 the 'SCSI target mode framework' (STMF):<\/p>\n<p class=\"brush: bash; gutter: true; first-line: 1\">You can not only map zVols but single (image) files on a filesystem or even single disks. The later one might make sense when you\u00a0 might have a hardware RAID controller where the OS only sees 1 virtual disk instead. - But often zVols tend to be the most integrated way (also in terms of performance) with STMF.\u00a0 In fact, the appliance OS from Nexenta only allows mapping zVols as SCSI LUNs.<\/p>\n<p><strong>stmfadm - SCSI target mode framework CLI<\/strong><\/p>\n<p>The GUID you saw previously is what we will finally map in STMF - this time I will just map the LUN to every initiator and every target we have:<\/p>\n<pre># stmfadm add-view 600144f098680b0000004e632dc60004\r\n# stmfadm list-view -l 600144f098680b0000004e632dc60004\r\nView Entry: 0\r\n    Host group   : All\r\n    Target group : All\r\n    LUN          : 2<\/pre>\n<p>In the next post I will write about how creating target and host groups allows to precisely map LUNs to a node with their HBAs. You should now see the newly mapped LUN from any FC-connected Host. - You might need to rescan the bus (i.e. use vendor-specifc script in Linux or refresh the\u00a0 Disk Management on Windows).<\/p>\n<p>2012.02: Updated a comment and fixed some errors.<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\"><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The first article was a bit specific on NexentaOS 3.x bust most of the things I&#8217;ll write here can be used (currently) 1:1 on OpenIndiana and SmartOS\u00a0 Live (once you get it installed on Disk). I&#8217;d not recommend using the UNIX shell within NexentaStor, the Appliance OS that comes with a Storage Management System (NMS) &#8230; <a class=\"moretag\" href=\"https:\/\/www.simweb.ch\/blog\/2011\/09\/nexenta-illumos-as-fc-target-2\/\">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-81","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\/81","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=81"}],"version-history":[{"count":0,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/posts\/81\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/media?parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/categories?post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.simweb.ch\/blog\/wp-json\/wp\/v2\/tags?post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}