on the target:
pkg install pkg://solaris/storage/storage-server
svcadm enable stmf
svcs stmf
zpool create iscsi c3t4d0
zfs create -V 500m iscsi/target
stmfadm create-lu \
/dev/zvol/rdsk/iscsi/target
Logical unit created: 600144F09B2A460000004FD211240001
stmfadm add-view \
600144F09B2A460000004FD211240001
stmfadm list-view -l \ 600144F09B2A460000004FD211240001
View Entry: 0
Host group : All
Target group : All
LUN : 0
svcadm enable svc:/network/iscsi/target:default
svcs iscsi/target
STATE STIME FMRI
online 16:56:12 svc:/network/iscsi/target:default
itadm create-target
Target iqn.1986-03.com.sun:02:b1dd32c7-54ec-e233-fcc9-8b0300f51f81 successfully created
itadm list-target -v
TARGET NAME STATE SESSIONS
iqn.1986-03.com.sun:02:b1dd32c7-54ec-e233-fcc9-8b0300f51f81 online 0
alias: -
auth: none (defaults)
targetchapuser: -
targetchapsecret: unset
tpg-tags: default
on the initiator:
svcadm enable network/iscsi/initiator
svcs network/iscsi/initiator
STATE STIME FMRI
online 16:13:36 svc:/network/iscsi/initiator:default
on the target:
itadm list-target
TARGET NAME STATE SESSIONS
iqn.1986-03.com.sun:02:b1dd32c7-54ec-e233-fcc9-8b0300f51f81 online 0
on the initiator:
iscsiadm add static-config \
> iqn.1986-03.com.sun:02:b1dd32c7-54ec-e233-fcc9-8b0300f51f81,192.168.1.161
(where the ip-address is the target's ip.)
iscsiadm list static-config
Static Configuration Target: iqn.1986-03.com.sun:02:b1dd32c7-54ec-e233-fcc9-8b0300f51f81,192.168.1.161:3260
iscsiadm modify discovery --static enable
iscsiadm list discovery
Discovery:
Static: enabled
Send Targets: disabled
iSNS: disabled
iscsiadm list target
Target: iqn.1986-03.com.sun:02:b1dd32c7-54ec-e233-fcc9-8b0300f51f81
Alias: -
TPGT: 1
ISID: 4000002a0000
Connections: 1
devfsadm -i iscsi
format
0. c0t600144F09B2A460000004FD211240001d0
/scsi_vhci/disk@g600144f09b2a460000004fd211240001
zpool create iscsi c0t600144F09B2A460000004FD211240001d0
(done)