How to add ISCSI targets in Solaris-shared storage setup

This article explains about adding the ISCSI target on Solaris node.Once you installed the openfiler,you have to provision LUN to specific target in order to access  LUNS in operating system.Once its done,then we just need to add those targets in OS to see those disks.Here we will see, how to add the iscsi target in Solaris in details manner. 

Assumption:Here i have already provision lun1 & lun2 to specific target

Login to Solaris host.
Enable the iscsi target service.

bash-3.00# svcadm enable iscsitgt
bash-3.00# svcs -a |grep iscsitgt
online 22:47:20 svc:/system/iscsitgt:default

Add the static target using the above mentioned target number.

# iscsiadm add static-config
Note:openfiler and Solaris host should be in same network in order to access the shared storage.
Openfiler IP: Default port:3260

Verify the target number
># iscsiadm list static-config
Static Configuration Target:,

Enable the discovery:

# iscsiadm modify discovery -s enable
Scan the LUN in OS side.
# devfsadm -i iscsi -v

# echo |format
Searching for disks...done
0. c1t0d0
1. c2t2d0
2. c2t3d0
Specify disk (enter its number): Specify disk (enter its number):
# uname -a
SunOS node2 5.10 Generic_142910-17 i86pc i386 i86pc
Now your shared storage setup is ready.You can add multiple target for same LUNS and that will act as alternative path for those LUNS.So that we can practice multi-pathing as well.

Thank you for reading this article.Please leave a comment if you have any doubt ,i will get back to you as soon as possible.