Thursday, February 19, 2015

Managing disks in solaris 11.2

HI everyone ..You probably are here because you maybe searching ho to make ISCSI or FC luns avilable through Solaris OS.

We then i wont be talking much but lets start working.

Initially please proceed if you have the following things:

1) A solaris machine with lots of Hard drive of course  ;)

Thing we will be needing  are as follows :

1) Internet connection
2) Solaris OS
3) Oracle account
..
The procedure are as follows :

First make sure you have the repo downloaded and setup your Local IPS repo. IF not you can visit my blog that explains ho to do that . Its title is creating a local IPS Repo in solaris.

Assuming you have create your repo lets move forward .
The first thing you want to do is intall comstar .
Comstar is a protocal that will be very important to create luns of disks.

Installing Comstar:

target# pkg install group/feature/storage-server
              Packages to install:    75
           Create boot environment:    No
               Services to restart:     7
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                75/75   9555/9555  105.7/105.7

PHASE                                        ACTIONS
Install Phase                            13347/13347 

PHASE                                          ITEMS
Package State Update Phase                     75/75 
Image State Update Phase                         2/2 
Loading smf(5) service descriptions: 17/17
Loading smf(5) service descriptions: 3/3

PHASE                                          ITEMS
Reading Existing Index                           8/8 
Indexing Packages                              75/75
Indexing Packages                              75/75
Optimizing Index...

PHASE                                          ITEMS
Indexing Packages                            573/573 

Either reboot the system or enable the stmf service.
  1. target# svcadm enable stmf
    # svcs stmf
    STATE          STIME    FMRI
    online         09:42:32 svc:/system/stmf:default

Now assuming that your stmf service is live lets start creating disks pool.

Create a ZPOOL

target# zpool create (desired pool name ) (disk names you want to include)

now that your pool is created lets create a volume that you want to share .
target# zfs create -V 2g sanpool/vol1

  1. Create a LUN for the ZFS volume.
    target# stmfadm create-lu /dev/zvol/rdsk/sanpool/vol1
    Logical unit created: 600144F0B5418B0000004DDAC7C10001
    You can find the device path for the ZFS volume in the /dev/zvol/rdsk/pool-name/ directory.
  2. Confirm that the LUN has been created.
    target# stmfadm list-lu
    LU Name: 600144F0B5418B0000004DDAC7C10001
  3. Add the LUN view.
    This command makes the LUN accessible to all systems.
    target# stmfadm add-view 600144F0B5418B0000004DDAC7C10001
    If you want to restrict the LUN view to specific systems, see How to Restrict LUN Access to Selected Systems.
  4. Verify the LUN configuration.
    target# stmfadm list-view -l 600144F0B5418B0000004DDAC7C10001
    View Entry: 0
        Host group   : All
        Target group : All
        LUN          : 0
Now as your Luns are avilable you need to configure you ISCSI target lets folow the below tutorial:

How to Create the iSCSI Target

This procedure assumes that you are logged in to the local system will contains the iSCSI target.
  1. Enable the iSCSI target service.
    target# svcadm enable -r svc:/network/iscsi/target:default
    Confirm that the service is enabled.
    target# svcs -l iscsi/target
    fmri         svc:/network/iscsi/target:default
    name         iscsi target
    enabled      true
    state        online
    next_state   none
    state_time   Mon May 23 14:48:59 2011
    logfile      /var/svc/log/network-iscsi-target:default.log
    restarter    svc:/system/svc/restarter:default
    dependency   require_any/error svc:/milestone/network (online)
    dependency   require_all/none svc:/system/stmf:default (online)
  2. Create the iSCSI target.
    target# itadm create-target
    Target iqn.1986-03.com.sun:02:73d12edc-9bb9-cb44-efc4-c3b36c039405 successfully created
  3. Display the iSCSI target information.
    target# itadm list-target -v
    TARGET NAME                                                  STATE    SESSIONS 
    iqn.1986-03.com.sun:02:73d12edc-9bb9-cb44-efc4-c3b36c039405  online   0        
            alias:                  -
            auth:                   none (defaults)
            targetchapuser:         -
            targetchapsecret:       unset
            tpg-tags:               default
Now as you are ready with the luns and a Target we need to configure the inititor to find the provided luns.

How to Configure an iSCSI Initiator

Part of the initiator configuration process is to identify the iSCSI target discovery method, which presents an initiator with a list of available targets. You can configure iSCSI targets for static, SendTargets, or iSNS dynamic discovery. Dynamic discovery using the SendTargets option is the optimum configuration for an iSCSI initiator that accesses a large number of targets, such over an iSCSI to Fibre Channel bridge. SendTargets dynamic discovery requires the IP address and port combination of the iSCSI target for the iSCSI initiator to perform the target discovery. The most common discovery method is SendTargets.
When configuring the target discovery method, you must provide the following information, depending on which method you choose:
  • SendTargets – Target IP address
  • iSNS – iSNS server address
  • Static – Target IP address and target name
For more information about configuring target discovery methods, see Configuring Dynamic or Static Target Discovery.
  1. Enable the iSCSI initiator service.
    initiator# svcadm enable network/iscsi/initiator
  2. Verify the target's name and IP address while logged in to the server that is providing the target.
    target# ipadm show-addr
    ADDROBJ           TYPE     STATE        ADDR
    lo0/v4            static   ok           127.0.0.1/8
    e1000g0/_b        dhcp     ok           10.80.227.189/24
    lo0/v6            static   ok           ::1/128
    e1000g0/_a        addrconf ok           fe80::214:4fff:fe27:360c/10
    target# itadm list-target -v
    TARGET NAME                                                  STATE    SESSIONS 
    iqn.1986-03.com.sun:02:73d12edc-9bb9-cb44-efc4-c3b36c039405  online   0        
            alias:                  -
            auth:                   none (defaults)
            targetchapuser:         -
            targetchapsecret:       unset
            tpg-tags:               default
  3. Configure the target to be statically discovered.
    initiator# iscsiadm add static-config iqn.1986-03.com.sun:02:73d12edc-9bb9-cb44-efc4-c3b36c039405,
    10.80.227.189
  4. Review the static configuration information.
    initiator# iscsiadm list static-config
    Static Configuration Target: iqn.1986-03.com.sun:02:73d12edc-9bb9-cb44-efc4-c3b36c039405,
    10.80.227.189:3260
    The iSCSI connection is not initiated until the discovery method is enabled. See the next step.
  5. Configure one of the following target discovery methods:
    • If you have configured a dynamically discovered (SendTargets) target, configure the SendTargets discovery method.
      initiator# iscsiadm add discovery-address 10.80.227.189
    • If you have configured a dynamically discovered (iSNS) target, configure the iSNS discovery method.
      initiator# iscsiadm add isns-server 10.80.227.189
  6. Enable one of the following the target discovery methods:
    • If you have configured a dynamically discovered (SendTargets) target, enable the SendTargets discovery method.
      initiator# iscsiadm modify discovery --sendtargets enable
    • If you have configured a dynamically discovered (iSNS) target, enable the iSNS discovery method.
      initiator# iscsiadm modify discovery --iSNS enable
    • If you have configured static targets, enable the static target discovery method.
      initiator# iscsiadm modify discovery --static enable
  7. Reconfigure the /dev namespace to recognize the iSCSI disk, if necessary.
    initiator# devfsadm -i iscsi

Now you are ready with a remote ISCSI disk ..use the format command to verify the same.



Now to deal with FC disk please follow the below procedure:

Configuring Fibre Channel Devices With COMSTAR

You can set up and configure a COMSTAR target on a SPARC system or x86 system in a FC network environment and make it accessible to the storage network. Ensure the following prerequisite step has been completed:

Configuring Fibre Channel Ports For COMSTAR

The Fibre Channel (FC) port provider can use the same HBAs that are used for the FC initiators. A given FC port can be used as an initiator or as a target, but not as both. You can also configure a dual port or quad port FC HBA so that a subset of the HBA ports is in target mode and the rest of the ports are in initiator mode.
The procedures in this section are specific to QLogic HBAs. The driver to use with HBAs in initiator mode is qlc, which is a Qlogic driver. The qlc driver works only in initiator mode, and cannot be used for target mode. The COMSTAR driver for a target QLogic 4G HBA is qlt.
Because initiator mode and target mode use different drivers, the driver you attach to an HBA port defines its function as a target or initiator. You can specify a driver for all the ports by specifying the PCI device ID of the HBA. Or, you can configure the driver on a port-by-port basis. Both methods use the update_drv command and are described in this section. For more information, see update_drv(1M).

How to Display Existing FC Port Bindings

Before making changes to the HBA ports, first check the existing port bindings.
  1. Become an administrator.
  2. Display what is currently bound to the port drivers.
    In this example, the current binding is pciex1077,2432.
    # mdb -k
    Loading modules: [ unix krtld genunix specfs ...
    > ::devbindings -q qlc
    30001617a08 pciex1077,2432, instance #0 (driver name: qlc)
    300016177e0 pciex1077,2432, instance #1 (driver name: qlc)
    > $q

How to Set All FC Ports to a Specific Mode

This procedure changes all ports on all HBAs with a specific PCI device ID to target mode. The PCI device ID number binds a driver to a port, thereby setting all the HBA ports with that PCI device ID, for example, all QLogic 4G PCI express HBAs, to target mode.
  1. Become an administrator.
  2. Remove the current binding.
    In this example, the qlc driver is actively bound to pciex1077,2432. You must remove the existing binding for qlc before you can add that binding to a new driver. Single quotation marks are required in this syntax.
    # update_drv -d -i 'pciex1077,2432' qlc
    Cannot unload module: qlc
    Will be unloaded upon reboot.
    This message does not indicate an error. The configuration files have been updated but the qlc driver remains bound to the port until the system is rebooted.
  3. Establish the new binding.
    In this example, qlt is updated. Single quotes are required in this syntax.
    # update_drv -a -i 'pciex1077,2432' qlt
    devfsadm: driver failed to attach: qlt
    Warning: Driver (qlt) successfully added to system but failed to attach
    This message does not indicate an error. The qlc driver remains bound to the port, until the system is rebooted. The qlt driver attaches when the system is rebooted.
  4. Reboot the system to attach the new driver. Then, recheck the bindings.
    # init 6
    .
    .
    .
    # mdb -k
    
    Loading modules: [ unix krtld genunix specfs dtrace ...
    > ::devbindings -q qlt
    30001615a08   pciex1077,2432, instance #0 (driver name: qlt)
    30001615e0    pciex1077,2432, instance #1 (driver name: qlt)
    > $q
  5. Verify that the target mode framework has access to the HBA ports.
    # stmfadm list-target -v
    Target: wwn.210100E08BA54E60
    Operational Status : Offline
    Provider Name : qlt(1)
    Alias : -
    Sessions : 0
    Target: wwn.210100E08BA54E60
    Operational Status : Offline
    Provider Name : qlt(0)
    Alias : -
    Sessions : 0

How to Set Selected FC Ports to Initiator or Target Mode

This procedure uses path-based bindings. It shows you how to use a specific device path to bind a port to a driver that is different from the driver to which it is currently bound.
  1. Become an administrator.
  2. Display a list of the HBA ports and their respective device paths.
    This example shows the device paths for a single HBA with two ports.
    # luxadm -e port
    /devices/pci@780/QLGC,qlc@0,1/fp@0,0:devctl CONNECTED
    /devices/pci@780/QLGC,qlc@0/fp@0,0:devctl CONNECTED
  3. Set the top port to target mode, and leave the bottom port in initiator mode.
    Remove the initial /devices portion of the path, and include everything up to /fp@0.... The path with the /devices portion removed is the path to which the system binds the qltdriver.
    Single quotation marks are required in this syntax.
    # update_drv -a -i '/pci@780/QLGC,qlc@0,1' qlt
    devfsadm: driver failed to attach: qlt
    Warning: Driver (qlt) successfully added to system but failed to attach.
    This message does not indicate an error. The qlc driver remains bound to the port until reboot. The qlt driver attaches during reboot.
  4. Reboot the system to attach the new driver. Then, recheck the bindings.
    You should see that the port changed from initiator mode (qlc) to target mode (qlt).
    # init 6
    .
    .
    .
    # mdb -k
    .
    .
    .
    > $q
  5. Verify that the target mode framework has access to the HBA ports.
    # stmfadm list-target -v

Making Logical Units Available for FC and FCoE

Simply registering a logical unit (LUN) with the STMF framework does not make it available to hosts (initiators) on the network. You must make logical units visible to initiator hosts for Fibre Channel and FCoE configurations by mapping the logical unit. To determine which method to use and how to map the logical unit, see How to Make a Logical Unit Available to All Systems. Both methods use the stmfadm command. The additional steps below are for FC and FCoE configurations.

How to Make Logical Units Available for FC and FCoE

This procedure makes the LUN available to all hosts or selected hosts for FC or FCoE configurations on a storage network. The steps are run on the host.
  1. Become an administrator.
  2. Make a LUN available to hosts.
    Obtain the global unique identification (GUID) number for the LUN.
    # sbdadm list-lu
    # stmfdm list-lu -v
    Identify the WWNs for the FC or FCoE ports of the host.
    # fcinfo hba-port
    HBA Port WWN: *210000e08b83378d*
    OS Device Name: /dev/cfg/c4
    Manufacturer: Qlogic Corp.
    Model: QLA2462
    Firmware Version: 4.0.27
    Fcode/BIOS Version: N/A
    Type: N-port
    State: online
    Supported Speeds: 1Gb 2Gb 4Gb
    Current Speed: 4Gb
    Node WWN: 210000e08b83378d
    HBA Port WWN: *210100e08ba3378d*
    OS Device Name: /dev/cfg/c5
    Manufacturer: Qlogic Corp.
    Model: QLA2462
    Firmware Version: 4.0.27
    Fcode/BIOS Version: N/A
    Type: N-port
    State: online
    Supported Speeds: 1Gb 2Gb 4Gb
    Current Speed: 4Gb
    Node WWN: 210100e08ba3378d
  3. Add a view and perform mapping.
  4. Verify that the LUN is visible on an Oracle Solaris initiator host by running the following script.
    #!/bin/ksh
    fcinfo hba-port |grep "^HBA" | awk '{print $4}' | while read 1n
    do
            fcinfo remote-port -p $1n -s >/dev/null 2>&1
    done
    All subsequent LUNs appear in the format output, because the script forces the initiator to touch all the LUNs through all the ports. If you do not see the LUNs, run the format command again. If you still do not see the LUNs, ensure that the service is enabled on the target by using the svcs stmf command. Also ensure that you added view entries for the LUN, as described in How to Make a Logical Unit Available to All Systems.
  5. Verify that the LUN is visible on other systems.
    • For a Linux initiator host, verify that the LUN is visible by running the utility provided by the HBA vendor. The utility scans for configuration changes.
    • For a Windows initiator host, verify that the logical unit is visible by selecting Control Panel -> Administrative Tools -> Computer Management -> Disk Management. Then, from the Action menu, choose Rescan Disks.

Saturday, January 31, 2015

How to Make Fibre Channel Storage Available to Oracle Solaris

How to Make Fibre Channel Storage Available to Oracle Solaris
With the Sun ZFS Storage Appliance

Introduction

Oracle Solaris 10 and Oracle Solaris 11 come with a Fibre Channel initiator stack you can configure to integrate Fibre Channel (FC) LUNs presented by the Sun ZFS Storage Appliance into the Oracle Solaris environment. This article describes how to configure the Oracle Solaris Fibre Channel stack and how to configure the Sun ZFS Storage Appliance to set up FC LUNs for access by Oracle Solaris servers. These configurations can be accomplished using the browser user interface (BUI).
The following assumptions have been made in this article:

  • The root password for the Sun ZFS Storage Appliance is known.
  • The IP address or host name of the Sun ZFS Storage Appliance is known.
  • The network used by the Sun ZFS Storage Appliance has been configured.
  • The Sun ZFS Storage Appliance has pools configured with sufficient free space available.
  • The root password for the Oracle Solaris server is known.
  • The Sun ZFS Storage Appliance is already connected to a Fibre Channel switch.
  • The appropriate zoning has been configured on the FC switch to allow the Oracle Solaris host to access the Sun ZFS Storage Appliance.
Configuring the Oracle Solaris FC Stack
Identifying the Sun ZFS Storage Appliance FC WWNs
  1. Enter an address in the address field of a Web browser that includes the IP address or host name of the Sun ZFS Storage Appliance as shown in the following URL:

https://<ip-address or host name>:215
  1. Figure 1
  1. Enter a username and password and click LOGIN.

  1. Click on Configuration > SAN > Fibre Channel Ports.

  1. Figure 2
Identifying the Oracle Solaris Host HBA WWNs
  1. To find the WWNs for the host, enter:

root@solaris:~# cfgadm -al -o show_FCP_dev
Ap_Id Type Receptacle Occupant Condition
[...]
c8 fc-fabric connected unconfigured unknown
c9 fc-fabric connected unconfigured unknown
root@solaris:~#
  1. If the HBA ports are not being used to access any other FC-connected devices, the following command can be used to determine the WWNs.

root@solaris:~# prtconf -vp | grep port-wwn
port-wwn: 210000e0.8b89bf8e
port-wwn: 210100e0.8ba9bf8e
root@solaris:~#
root@solaris:~# luxadm -e dump_map /dev/cfg/c8
Pos Port_ID Hard_Ad Port WWN Node WWN Type
0 2000 0 xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx 0x0 (Disk
device)
[...]
3 25600 0 2100000e08b89bf8e 200000e08b89bf8e 0x1f (Unknown
type, Host Bus Adapter)
root@solaris:~#
  1. From the output, you can see that c8 has the WWN 21:00:00:00:e0:8b:89:bf:8e and c9 has WWN21:01:00:e0:8b:a9:bf:8e.

root@solaris:~# cfgadm -al -o show_FCP_dev c8 c9
Ap_Id Type Receptacle Occupant Condition
[...]
c8 fc-fabric connected configured unknown
c8::210100e08bb2a1cf unknown connected unconfigured unknown
c9 fc-fabric connected configured unknown
c9::210000e08b92a1cf unknown connected unconfigured unknown
root@solaris:~#
Configuring the Sun ZFS Storage Appliance Using the Browser User Interface
Defining an FC Target Group
  1. Click Configuration > SAN to display the Storage Area Network (SAN) screen, as shown in Figure 3.
  1. Click the Targets tab at the right and then select Fibre Channel Ports at the top of the left panel, as shown in Figure 3.
  1. Place the mouse in the Fibre Channel Ports box and a Move icon (move icon) will appear in the far left, as shown in Figure 3.

  1. Figure 3
  1. Click on the Move icon and drag the box to the Fibre Channel Target Groups box, as demonstrated in Figure 4.

  1. Figure 4
  1. Drop the entry in the orange box to create a new target group. The group is created and named automatically as targets-n where nis an integer. See the example targets-0 in Figure 5.

  1. Figure 5
  1. Move the cursor over the entry for the new target group. Two icons appear to the right of the Fibre Channel Target Groups box, as shown in Figure 6.

  1. Figure 6
  1. To rename the new target group targets-0, click the Edit icon (edit icon) to display the dialog box shown in Figure 7.

  1. Figure 7
  1. In the Name field, replace the default name with your preferred name for the new FC target group and click OK. For this example, the name FC-PortGroup replaces targets-0. In this window, you can also add the second FC target port by clicking in the box to the left of the WWN you are choosing. In the example in Figure 7, this second port is identified as PCIe 1: Port 2.
  1. Click OK to save the changes.
  1. Click APPLY. The changes are shown in the Fibre Channel Target Groups panel in Figure 8. 

  1. Figure 8
Defining an FC Initiator
  1. Click Configuration > SAN to display the Storage Area Network (SAN) screen shown in Figure 9.
  1. Click the Initiators tab at the right and then select Fibre Channel Initiators at the top of the left panel, as shown in Figure 9.

  1. Figure 9
  1. Click the plus icon icon to the left of Fibre Channel Initiators to display the New Fibre Channel Initiator dialog box shown in Figure 10.

  1. Click on one of the WWNs (if they are displayed) at the bottom of the dialog box to prepopulate the World Wide Name or type the appropriate WWN in to the World Wide Name box.
  1. Enter a more meaningful symbolic name in the Alias box.

  1. Figure 10
  1. Click OK.
  1. Repeat the preceding steps for the other WWN(s) that refer to the Oracle Solaris host.
Defining the FC Initiator Group
  1. Select Configuration > SAN to display the Storage Area Network (SAN) screen.
  1. Select the Initiators tab at the right and then click Fibre Channel Initiators at the top of the left panel.
  1. Place the cursor over the entry for one of the FC initiators created in the previous section. The Move icon (move icon) appears to the left of the entry, as shown in Figure 11.

  1. Figure 11
  1. Click the Move icon and drag it to the Fibre Channel Initiator Groups panel on the right. A new entry appears (highlighted in yellow) at the bottom of the Fibre Channel Initiators Groups panel shown in Figure 12.

  1. Figure 12
  1. Move the cursor over the new entry box and release the mouse button. A new FC initiator group is created with the nameinitiators-n, where n is an integer, as shown in Figure 13.
  1. Move the cursor over the entry for the new initiator group. Several icons appear to the right of the target initiator group box, as shown in Figure 13.

  1. Figure 13
  1. Click the Edit icon (edit icon) to display the dialog box shown in Figure 14.
  1. In the Name field, replace the new initiator group's default name with a chosen name and click OK. For this example, the name sol-server is used.

  1. Figure 14
  1. Click APPLY on the SAN configuration screen to confirm all the modifications, as shown in Figure 15.

  1. Figure 15
Defining a Sun ZFS Storage Appliance Project
  1. Select Shares > Projects to display the Projects screen, as shown in Figure 16. 

  1. Figure 16
  1. Click the plus icon icon to the left of Projects at the top of the left panel to display the Create Project dialog box shown in Figure 17.

  1. Figure 17
  1. To create a new project, enter a name for the project and click APPLY. A new project appears in the Projects list in the left panel.
  1. Select the new project to view the components that comprise the project, as shown in Figure 18.

  1. Figure 18
Defining a Sun ZFS Storage Appliance LUN
  1. Select Shares > Projects to display the Projects screen.
  1. In the Projects panel at the left, select the project. Then select LUNs at the top of the panel at the right, as shown in Figure 19.

  1. Figure 19
  1. Click the plus icon icon to the left of LUNs to display the Create LUN dialog box shown in Figure 20.
  1. Enter values as appropriate to set up the LUN. For this example, set Name to DocArchive1Volume size to 64 G, and select theThin provisioned checkbox. Set Target Group to the FC target group FC-PortGroup and set Initiator Group to sol-server. SetVolume block size to 32k because the volume will hold an Oracle Solaris ZFS file system.

  1. Figure 20
  1. Click APPLY to create the LUN and make it available to the Oracle Solaris server.
Configuring the LUN for Use by the Oracle Solaris Server
  1. Initiate an Oracle Solaris FC session with the Sun ZFS Storage Appliance, as shown in Listing 1. Since the LUN was created prior to initiating the FC session, it will be automatically enabled.

  1. Listing 1. Initiating an Oracle Solaris FC session
root@solaris:~# cfgadm -al c8 c9
root@solaris:~# cfgadm -c configure c8::210100e08bb2a1cf
root@solaris:~# cfgadm -c configure c9::210000e08b92a1cf
root@solaris:~# cfgadm -al -o show_FCP_dev c8 c9
Ap_Id Type Receptacle Occupant Condition
c8 fc-fabric connected configured unknown
c8::210100e08bb2a1cf,0 disk connected configured unknown
c9 fc-fabric connected configured unknown
c9::210000e08b92a1cf,0 disk connected configured unknown
root@solaris:~#
  1. Verify access to the FC LUN, as shown in Listing 2.

  1. Listing 2. Verifying access to the FC LUN
root@solaris:~# devfsadm -c ssd
root@solaris:~# tail /var/adm/messages
[...]
Nov 30 06:30:00 solaris last message repeated 2 times
Nov 30 06:32:22 solaris scsi: [ID 799468 kern.info] ssd42 at
scsi_vhci0: name g600144f0f05e906c00004ed6096d0001, bus address
g600144f0f05e906c00004ed6096d0001
Nov 30 06:32:22 solaris genunix: [ID 936769 kern.info] ssd42 is
/scsi_vhci/ssd@g600144f0f05e906c00004ed6096d0001
Nov 30 06:32:22 solaris scsi: [ID 107833 kern.warning] WARNING:
/scsi_vhci/ssd@g600144f0f05e906c00004ed6096d0001 (ssd42):
Nov 30 06:32:22 solaris Corrupt label; wrong magic number
Nov 30 06:32:22 solaris genunix: [ID 408114 kern.info]
/scsi_vhci/ssd@g600144f0f05e906c00004ed6096d0001 (ssd42) online
Nov 30 06:32:22 solaris genunix: [ID 834635 kern.info]
/scsi_vhci/ssd@g600144f0f05e906c00004ed6096d0001 (ssd42)
multipath status: degraded, path
/pci@1e,600000/SUNW,qlc@2/fp@0,0 (fp1) to target address:
w210100e08bb2a1cf,0 is online Load balancing: round-robin
Nov 30 06:32:22 solaris scsi: [ID 107833 kern.warning] WARNING:
/scsi_vhci/ssd@g600144f0f05e906c00004ed6096d0001 (ssd42):
Nov 30 06:32:22 solaris Corrupt label; wrong magic number
Nov 30 06:32:49 solaris genunix: [ID 834635 kern.info]
/scsi_vhci/ssd@g600144f0f05e906c00004ed6096d0001 (ssd42)
multipath status: optimal, path
/pci@1e,600000/SUNW,qlc@2,1/fp@0,0 (fp3) to target address:
w210000e08b92a1cf,0 is online Load balancing: round-robin
[...]
  1. Format the LUN as shown in Listing 3.

  1. Listing 3. Formatting the LUN
root@solaris:~# format
Searching for disks...done
c1t600144F0F05E906C00004ED6096D0001d0: configured with capacity of 63.93GB
AVAILABLE DISK SELECTIONS:
[...]
4. c1t600144F0F05E906C00004ED6096D0001d0 <SUN-SunStorage7210-1.0 cyl 2078 alt 2 hd 254 sec 254>
/scsi_vhci/ssd@g600144f0f05e906c00004ed6096d0001
[...]
Specify disk (enter its number): 4
selecting c1t600144F0F05E906C00004ED6096D0001d0
[disk formatted]
Disk not labeled. Label it now? y
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> q
  1. Build an Oracle Solaris ZFS file system on the prepared LUN by creating a new ZFS pool, adding this device to the ZFS pool, and creating the ZFS file system, as shown in the example in Listing 4.

  1. Listing 4. Building an Oracle Solaris ZFS file system
root@solaris:~# zfs createzpool create docarchive1 \
c1t600144F0F05E906C00004ED6096D0001d0
root@solaris:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
docarchive1 72K 62.5G 21K /docarchive1
rpool 25.4G 41.5G 97K /rpool
rpool/ROOT 22.3G 41.5G 21K legacy
[...]
root@solaris:~# zfs create docarchive1/index
root@solaris:~# zfs create docarchive1/data
root@solaris:~# zfs create docarchive1/logs
root@solaris:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
docarchive1 159K 62.5G 24K /docarchive1
docarchive1/data 21K 62.5G 21K /docarchive1/data
docarchive1/index 21K 62.5G 21K /docarchive1/index
docarchive1/logs 21K 62.5G 21K /docarchive1/logs
rpool 25.4G 41.5G 97K /rpool
rpool/ROOT 22.3G 41.5G 21K legacy
[...]
Conclusion
by Andrew Ness, February 2012
Introduction
Oracle Solaris 10 and Oracle Solaris 11 come with a Fibre Channel initiator stack you can configure to integrate Fibre Channel (FC) LUNs presented by the Sun ZFS Storage Appliance into the Oracle Solaris environment. This article describes how to configure the Oracle Solaris Fibre Channel stack and how to configure the Sun ZFS Storage Appliance to set up FC LUNs for access by Oracle Solaris servers. These configurations can be accomplished using the browser user interface (BUI).
The following assumptions have been made in this article:
To identify the Sun ZFS Storage Appliance and the Oracle Solaris server to each other, the FC World Wide Number (WWN) for each must be registered with the other. You must determine the WWNs for some forms of FC zoning implemented on the FC switch.
The FC WWN of the host is used to identify the host to the Sun ZFS Storage Appliance and is needed to complete the configuration procedure in this article.
The WWNs are taken from the FC Host Bus Adapters (HBAs) installed in the Oracle Solaris host and the Sun ZFS Storage Appliance.
In order to configure the Oracle Solaris FC stack, you will need to know the WWNs of the Sun ZFS Storage Appliance. In a traditional dual-fabric Storage Area Network (SAN), the Sun ZFS Storage Appliance will have at least one FC port attached to each fabric. Thus, you must determine at least two FC WWNs.
First, you need to establish a management session with the Sun ZFS Storage Appliance.
  1. The login dialog box is displayed.
  1. Figure 1. Sun ZFS Storage Appliance login
  1. Once you have successfully logged in to the BUI, you can identify the WWNs through the Configuration tab.
  1. Figure 2. Fibre Channel port configuration for SAN
    The FC ports installed in the Sun ZFS Storage Appliance are shown. Since there is only one discovered port per HBA channel, this must be the HBA channel itself.
    In the preceding case, port 1 has the WWN 21:00:00:e0:8b:92:a1:cf and port 2 has the WWN 21:01:00:e0:8b:b2:a1:cf.
    The FC channel ports should be set to Target in the list box to the right of each FC port box. If this is not the case, the FC ports may be in use for another purpose. Do not change the setting until you have investigated the reason. (One possible reason may be for NDMP backups.)
If the Oracle Solaris host is already attached to the FC switch by the appropriate cables, use the following command to identify the WWNs.
  1. From this output, the controller numbers you need are c8 and c9. You can also see that both ports are attached to an FC switch, as the port type is fc-fabric. Next, interrogate these controllers to determine what WWNs are discovered.
  1. Alternatively, if FC devices are being accessed, the following command will show the FC HBA WWNs.
    The last entry shown as type 0x1f (Unknown type, Host Bus Adapter) gives the appropriate WWN under the port WWN entry. Repeat the command substituting /dev/cfg/c8 for the other controllers identified in step 1.
  1. The Sun ZFS Storage Appliance HBA and the Oracle Solaris host HBA WWNs can then be used to configure any FC switch zoning.
    Once this has been completed, you can verify the proper zoning by running the following command:
    You can now see the WWNs presented by the Sun ZFS Storage Appliance that are accessible by the Oracle Solaris host.
As a unified storage platform, the Sun ZFS Storage Appliance supports access to block-protocol LUNs using iSCSI and Fibre Channel protocols. This section describes how to use the Sun ZFS Storage Appliance BUI to configure the Sun ZFS Storage Appliance to recognize the Oracle Solaris host and present FC LUNs to it.
A target group is created on the Sun ZFS Storage Appliance to define the ports and the protocol by which the LUN to be presented to the Oracle Solaris server is accessed. For this example, an FC target group is created.
To define an FC target group on the Sun ZFS Storage Appliance, complete these steps:
  1. Figure 3. Selecting the Fibre Channel port
  1. Figure 4. Dragging the Fibre Channel port entry
  1. Figure 5. Newly created Fibre Channel target group
  1. Figure 6. Selecting the FC target group
  1. Figure 7. Renaming the FC Target Group
  1. Figure 8. New FC target group with changes applied
An FC initiator is defined to allow access from one or more servers to particular volumes. Permissions to volumes should be configured so that a minimum number of FC initiators are allowed to access a particular volume. If more than one host can write to a given volume concurrently and a non-shared file system is used, inconsistencies may occur in file system caches on the hosts that can ultimately lead to corruption of the on-disk image. Typically a single initiator is given access to a volume, unless a specialized cluster file system is being used.
The FC initiator serves to define the "host" from the point of view of the Sun ZFS Storage Appliance. In a traditional dual-fabric SAN, the host will be defined by at least two FC initiators. The FC initiator definition contains the host WWNs. To identify the Oracle Solaris server to the Sun ZFS Storage Appliance, the Oracle Solaris FC initiator WWNs must then be registered with the appliance by completing the following steps.
  1. Figure 9. Selecting the SAN configuration
  1. If the zoning has been configured on the FC switches, the WWNs of the Oracle Solaris host should be displayed (assuming they are not assigned to an alias already).
  1. Figure 10. New Fibre Channel initiator definition
Related FC initiators are combined into logical groups to allow single commands to execute on multiple FC initiators, for example, assigning LUN access to all FC initiators in a group with one command. For the following example, the FC initiator group will contain two initiators. Note that in a cluster, where multiple servers are treated as a single logical entity, the initiator group may contain many more initiators.
To create an FC initiator group, complete these steps:
  1. Figure 11. Displaying the Move icon for the new FC initiator
  1. Figure 12. Creating the FC initiator group
  1. Figure 13. Selecting the Fibre Channel initiator group
  1. In this dialog box, you can add the other FC initiator(s) to the group by clicking the checkbox to the left of the WWN.
  1. Figure 14. Renaming and completing the FC initiator group
  1. Figure 15. Completed FC initiator configuration
To group related volumes, you can define a project in the Sun ZFS Storage Appliance. A project allows inheritance of properties for file systems and LUNs presented from the project. A project also allows you to apply quotas and reservations.
To create a project, complete the steps below:
  1. Figure 16. Viewing a project
  1. Figure 17. Create Project dialog box
  1. Figure 18. Displaying the new project sol-project
Next, you will create a LUN from an existing pool of storage resources that the Oracle Solaris server will access. In the following example, a thin-provisioned 64-GB LUN called DocArchive1 is created.
The target group will be the FC target group, FC-PortGroup, which was created in the section Defining an FC Target Group, to ensure that this LUN can be accessed using the FC protocol. The initiator group defined in the section Defining the FC Initiator Groupsol-server, will be used to ensure that only the server(s) defined in the sol-server group can access this LUN. (In this example, this group contains only one server.)
To create a target group, complete the following steps:
  1. Figure 19. Selecting Shares > Project > LUNs
  1. Figure 20. New LUN dialog box
Now that the LUN is prepared and available to the FC initiator group, the LUN must be configured for use by the Oracle Solaris server by completing the following steps:
  1. In this example, the multipath status is shown as degraded initially because only one path had been identified at that point. Further on, the multipath status changes to optimal due to the presence of multiple paths to the volume.
    The disk device is now similarly available to an internal server disk.
  1. The final two lines of the output from the df(1) command show that approximately 64 GB of new space is now available.
This article has described how to configure the FC initiator stack supplied with Oracle Solaris 10 and Oracle Solaris 11 to enable an Oracle Solaris server to access Fibre Channel LUNs presented by the Sun ZFS Storage Appliance.