FAQ / Creating iSCSI Target and Logical Unit configuration on a clustered pool

Assuming a two node cluster with members nodea and nodeb, create an iSCSI Target to receive SCSI I/O commands for the Logical Unit on the first cluster node:

root@nodea:~# itadm create-target
Target iqn.1986-03.com.sun:02:31ac217b-bed5-e8c2-919b-eafd4f1bb413 successfully created

Create the same iSCSI Target on the second cluster node to receive SCSI I/O commands for the Logical Unit when the pool is failed over:

root@nodeb:~# itadm create-target -n iqn.1986-03.com.sun:02:31ac217b-bed5-e8c2-919b-eafd4f1bb413
Target iqn.1986-03.com.sun:02:31ac217b-bed5-e8c2-919b-eafd4f1bb413 successfully created

Create a 10GB zvol in the pool to use as backing store for the Logical Unit:

root@nodea:~# zfs create -V 10g Shared/iscsivol01

Create the Logical Unit using the newly created zvol as backing store:

root@nodea:~# stmfadm create-lu /dev/zvol/rdsk/Shared/iscsivol01
Logical unit created: 600144F07D5FB35600004F50B4C70001

Check the logical unit status

root@nodea:/opt/HAC/RSF-1/etc# stmfadm list-lu -v
LU Name : 600144F07D5FB35600004F50B4C70001
   Operational Status: Online
   Provider Name     : sbd
   Alias             : /dev/zvol/rdsk/Shared/iscsivol01
   View Entry Count  : 0
   Data File         : /dev/zvol/rdsk/Shared/iscsivol01
   Meta File         : not set
   Size              : 10737418240
   Block Size        : 512
   Management URL    : not set
   Vendor ID         : NEXENTA
   Product ID        : COMSTAR
   Serial Num        : not set
   Write Protect     : Disabled
   Writeback Cache   : Enabled
   Access State      : Active

Add a default view to allow all client initiators to send SCSI I/O Commands to the Logical Unit via the iSCSI Target:

root@nodea:~# stmfadm add-view 600144F07D5FB35600004F50B4C70001
root@nodea:~# stmfadm list-view -l 600144F07D5FB35600004F50B4C70001
View Entry: 0
    Host group   : All
    Target group : All
    LUN          : 0

Run map manager to backup the Logical Unit’s view to the pool in preparation for failover:

root@nodea:~# mapmgr backup Shared

Failover the pool to nodeb:

root@nodea:~# rsfcli -i=0 move Shared nodeb
NB. This command may leave some servers in manual mode.
    You must manually switch them back to automatic mode
    after the service has moved as required.

Verify the Logical Unit is loaded into COMSTAR on nodeb:

root@nodeb:~# stmfadm list-lu -v
LU Name: 600144F07D5FB35600004F50B4C70001
    Operational Status: Online
    Provider Name     : sbd
    Alias             : /dev/zvol/rdsk/Shared/iscsivol01
    View Entry Count  : 1
    Data File         : /dev/zvol/rdsk/Shared/iscsivol01
    Meta File         : not set
    Size              : 10737418240
    Block Size        : 512
    Management URL    : not set
    Vendor ID         : NEXENTA
    Product ID        : COMSTAR
    Serial Num        : not set
    Write Protect     : Disabled
    Writeback Cache   : Enabled
    Access State      : Active

Verify the Logical Unit’s view is recreated by map manager on nodeb:

root@nodeb:~# stmfadm list-view -l 600144F07D5FB35600004F50B4C70001
View Entry: 0
    Host group   : All
    Target group : All
    LUN          : 0

Finally test the Logical Unit via the iSCSI Target using a suitable initiator connecting to the service’s virtual IP address (in this example 192.168.50.194) on port 3260 as follows:

iqn.1986-03.com.sun:02:31ac217b-bed5-e8c2-919b-eafd4f1bb413, 192.168.50.194:3260

Posted in: NexentaStor