Thursday, 18 December 2014

Oracle Solaris 11 come up with the new feature named as Common Multiprotocol SCSI Target (COMSTAR) which supports iSCSI protocol. Any of Oracle Solaris 11 server can be make as iSCSI target which provides storage to other machines. iSCSI initiator which act as Host bus adapter (HBA) to access the storage which offered by iSCSI target server. 

High Level Plan:
  • Install storage-server package and enable the stmf services
  • Create Storage Pool
  • Create a Storage LUN (iSCSI Volume) by using "stmfadm"
  • Enable iSCSI target service
  • Create iSCSI target by using "itadm"
  • Enable  iSCSI initiator on Client machine.
  • Discover and Configure the new LUN on Client machine.
Installing Storage-server package
root@unixrock:~# pkg search storage-server
INDEX       ACTION VALUE                                PACKAGE
incorporate depend pkg:/storage-server@0.1,5.11-0.133   pkg:/consolidation/osnet/osnet-incorporation@0.5.11-0.175.2.2.0.5.2
pkg.fmri    set    solaris/group/feature/storage-server pkg:/group/feature/storage-server@0.5.11-0.175.2.0.0.42.2
pkg.fmri    set    solaris/storage-server               pkg:/storage-server@0.1-0.133
pkg.fmri    set    solaris/storage/storage-server       pkg:/storage/storage-server@0.1-0.173.0.0.0.1.0
root@unixrock:~# 
root@unixrock:~# pkg install storage-server
           Packages to install:  30
            Services to change:   1
       Create boot environment:  No
Create backup boot environment: Yes
Planning linked: 0/1 done; 1 working: zone:rockzone1
Planning linked: 1/1 done
DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                              30/30     4811/4811  117.5/117.5    0B/s

Downloading linked: 0/1 done; 1 working: zone:rockzone1
Downloading linked: 1/1 done
PHASE                                          ITEMS
Installing new actions                     6248/6248
Updating package state database                 Done
Updating package cache                           0/0
Updating image state                            Done
Creating fast lookup database                   Done
Executing linked: 0/1 done; 1 working: zone:rockzone1
Executing linked: 1/1 done
Updating package cache                           1/1
root@unixrock:~#
Enabling the stmf services which provides the iscsi target services
root@unixrock:~# pkg list storage-server
NAME (PUBLISHER)                                  VERSION                    IFO
group/feature/storage-server                      0.5.11-0.175.2.0.0.42.2    i--
root@unixrock:~#
root@unixrock:~# svcs -a | grep stmf
disabled        0:23:57 svc:/system/stmf:default
root@unixrock:~# svcadm enable svc:/system/stmf:default
root@unixrock:~# svcs -a | grep stmf
online          0:47:54 svc:/system/stmf:default
root@unixrock:~#
Creating storage pool
root@unixrock:~# echo |format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c2t0d0 
          /pci@0,0/pci15ad,1976@10/sd@0,0
       1. c2t1d0 
          /pci@0,0/pci15ad,1976@10/sd@1,0
       2. c2t2d0 
          /pci@0,0/pci15ad,1976@10/sd@2,0
       3. c4t4d0 
          /iscsi/disk@0000iqn.2006-01.com.openfiler%3Atsn.aa0731cca3b80001,0
       4. c4t6d0 
          /iscsi/disk@0000iqn.2006-01.com.openfiler%3Atsn.aa0731cca3b80001,2
       5. c4t7d0 
          /iscsi/disk@0000iqn.2006-01.com.openfiler%3Atsn.aa07215dc1e60001,0
       6. c4t9d0 
          /iscsi/disk@0000iqn.2006-01.com.openfiler%3Atsn.aa07215dc1e60001,2
       7. c4t10d0 
          /iscsi/disk@0000iqn.2006-01.com.openfiler%3Atsn.aa07215dc1e60001,3
Specify disk (enter its number): Specify disk (enter its number):
root@unixrock:~#
root@unixrock:~# zpool create rockiscsi_pool c4t10d0
root@unixrock:~#
root@unixrock:~# zfs create -V 50m rockiscsi_pool/iscsi_Volume
root@unixrock:~#
root@unixrock:~# zfs list rockiscsi_pool/iscsi_Volume
NAME                          USED  AVAIL  REFER  MOUNTPOINT
rockiscsi_pool/iscsi_Volume  51.8M  82.9M    16K  -
root@unixrock:~#
Create a Storage LUN (iSCSI Volume) by using "stmfadm"
root@unixrock:/# stmfadm list-state
Operational Status: online
Config Status     : initialized
ALUA Status       : disabled
ALUA Node         : 0
root@unixrock:/#
root@unixrock:~# stmfadm create-lu /dev/zvol/rdsk/rockiscsi_pool/iscsi_Volume
Logical unit created: 600144F08C1E4600000054416CB30001
root@unixrock:~#
root@unixrock:~# stmfadm list-lu
LU Name: 600144F08C1E4600000054416CB30001
root@unixrock:~# stmfadm add-view 600144F08C1E4600000054416CB30001
root@unixrock:~# stmfadm list-view -l 600144F08C1E4600000054416CB30001
View Entry: 0
    Host group   : All
    Target Group : All
    LUN          : Auto
root@unixrock:~#
Enable iSCSI target service
root@unixrock:~# svcs -a | grep target
disabled        0:23:12 svc:/network/iscsi/target:default
disabled        0:23:36 svc:/system/fcoe_target:default
disabled        0:24:10 svc:/system/ibsrp/target:default
root@unixrock:~#
root@unixrock:~# svcadm enable svc:/network/iscsi/target:default
root@unixrock:~# svcs svc:/network/iscsi/target:default
STATE          STIME    FMRI
online          0:55:40 svc:/network/iscsi/target:default
root@unixrock:~#
Create iSCSI target by using "itadm"
root@unixrock:~# itadm create-target
Target iqn.1986-03.com.sun:02:77c8bf02-16ea-e333-fb6a-f98c55466542 successfully created
root@unixrock:~# itadm list-target -v
TARGET NAME                                                  STATE    SESSIONS
iqn.1986-03.com.sun:02:77c8bf02-16ea-e333-fb6a-f98c55466542  online   0
        alias:                  -
        auth:                   none (defaults)
        targetchapuser:         -
        targetchapsecret:       unset
        tpg-tags:               default
root@unixrock:~# itadm list-defaults
iSCSI Target Default Properties:

alias:          
auth:           o
radiusserver:   
radiussecret:   unset
isns:           disabled
isnsserver:     
root@unixrock:~#
Now we are ready to confirgure in client system, Please follow the steps in client system where we need to configure the COMSTAR Checking initiator Configuration is enabled and make it sure the connectivity between Target machine and sources.
root@unixrock_client:~# ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
net0/v4client     static   ok           192.168.113.140/24
root@unixrock_client:~#
root@unixrock_client:~# ping unixrock
unixrock is alive
root@unixrock_client:~#
root@unixrock_client:~# svcs -a | grep initiator
online         19:57:35 svc:/system/fcoe_initiator:default
online         19:57:57 svc:/network/iscsi/initiator:default
root@unixrock_client:~#
List the target details
root@unixrock_client:~# itadm list-target
TARGET NAME                                                  STATE    SESSIONS
iqn.1986-03.com.sun:02:77c8bf02-16ea-e333-fb6a-f98c55466542  online   0
root@unixrock_client:~#
root@unixrock_client:~# itadm list-target -v
TARGET NAME                                                  STATE    SESSIONS
iqn.1986-03.com.sun:02:77c8bf02-16ea-e333-fb6a-f98c55466542  online   0
        alias:                  -
        auth:                   none (defaults)
        targetchapuser:         -
        targetchapsecret:       unset
        tpg-tags:               default
root@unixrock_client:~#
Configuring the iscsi on client system
root@unixrock_client:~# iscsiadm add static-config iqn.1986-03.com.sun:02:77c8bf02-16ea-e333-fb6a-f98c55466542,192.168.113.139
root@unixrock_client:~# iscsiadm list static-config
Static Configuration Target: iqn.1986-03.com.sun:02:77c8bf02-16ea-e333-fb6a-f98c55466542,192.168.113.139:3260
root@unixrock_client:~#
Static is disabled status which needs to be enabled
root@unixrock_client:~# iscsiadm list discovery
Discovery:
        Static: disabled
        Send Targets: disabled
        iSNS: disabled
root@unixrock_client:~#
Enabling iscsi static
root@unixrock_client:~# iscsiadm modify discovery --static enable
root@unixrock_client:~# iscsiadm list discovery
Discovery:
        Static: enabled
        Send Targets: disabled
        iSNS: disabled
root@unixrock_client:~# iscsiadm list target
Target: iqn.1986-03.com.sun:02:77c8bf02-16ea-e333-fb6a-f98c55466542
        Alias: -
        TPGT: 1
        ISID: 4000002a0000
        Connections: 1
root@unixrock_client:~#
Yes, Now we are almost completed and we can able to access the iscsi target from client, Let we can discover the disk.
root@unixrock_client:~# devfsadm -Cc disk
root@unixrock_client:~# echo|format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c0t600144F08C1E460000005492F2380001d0 
          /scsi_vhci/disk@g600144f08c1e460000005492f2380001
COOL.....Now we are able to see the iscsi target disk from client machine, Now we good to create the zpool and configure further. Thanks for reading this post, Please leave your valuable comments and queries, i will respond to you at earliest.