Thursday, May 15, 2014

Creating iSCSI LUN Visible by Selected Node.


(VERSION INFORMATION: Solaris 11.1)


This restrict selected targets visible to initiator i.e. host group and selected LUN for particular target.
This is one of the best practice when provision LUN.

  • 1. Create ZFS pool.
zpool create db-pool c0t600A0B800056405E0000621E530C68E7d0
zpool add -f db-pool c0t600A0B800056405E000049EF5253ECF4d0




  • 2. create zfs disk/volume
zfs create -V 4g db-pool/dbvot1
  • 3. Make ZFS volume LUN
stmfadm create-lu /dev/zvol/rdsk/db-pool/dbvot1

  • 4. Enable scsi initiator (on all the isci client node)
svcadm enable network/iscsi/initiator
svcs -l iscsi/initiator ##check





  • 5. iscsiadm list initiator-node [all client node]


The highlighted section will be used in the next command. Sample principle apply for FC WWN.

  • 6. stmfadm create-hg host-db #[iscsi server node]
  • 7. stmfadm add-hg-member -g host-db iqn.1986-03.com.sun:01:00144ffba06e.535be0bb iqn.1986-03.com.sun:01:00144ff99ca4.535be0e7

  • 8. stmfadm create-tg target-racdb00
Create target group




  • 9. Create the iSCSI
#itadm create-target

  • 10. itadm list-target v


  • 11. PrimayNode #stmfadm offline-target iqn.1986-03.com.sun:02:315667dd-969a-e405-f715-c6d61ace3acb
Need to make target offline, if it online. See screenshot above.

  • 12. PrimayNode #stmfadm add-tg-member -g target-racdb00 iqn.1986-03.com.sun:02:315667dd-969a-e405-f715-c6d61ace3acb
Add “iscsi target” to the target group






  • 13. PrimayNode #stmfadm list-lu v
Check available iSCSI LUN.


Can you create ZFS iSCSI


SCSI LUN created in step 1 to 3.

  • 14. PrimayNode # stmfadm add-view -h host-db -t target-racdb00 -n 10 600144F000212834D270536B68270002
Adding LUN to host group and target group.

  • 15. PrimaryNode #stmfadm list-view -l 600144F000212834D270536B68270002




  • 16. Bring logical unit online.
PrimaryNode #stmfadm online-target iqn.1986-03.com.sun:02:315667dd-969a-e405-f715-c6d61ace3acb





  • 17. Activate client’s initiator
root@dbnode1:~# iscsiadm list discovery
root@dbnode1:~# iscsiadm modify discovery -t enable







  • 18. Add iSCSI address and port(default is 3260)
root@dbnode1:~# iscsiadm add discovery-address 192.168.200.21:3260







  • 19. root@dbnode1:~# iscsiadm list target


  • 20. Dynamically update /dev and /devices.
root@dbnode1:~# devfsadm v





  • 21. root@dbnode1:~# format








Other Cheat Commands:
  • 1. delete logical unit view
stmfadm remove-view -l 600144F000212834D270536B68270002 0
  • 2. stmfadm à SCSI Target Mode Framework






No comments:

Post a Comment