3

I'm creating a number of iSCSI targets on an OpenIndiana server using COMSTAR. Basically:

  • zfs create -V 10g pool/comstar/vol
  • sbdadm create-lu /dev/zvol/rdsk/pool/comstar/vol
  • stmfadm add-view 600144F077000000000048C62BF00001
  • itadm create-target

It's that last part I'm having a hard time understanding because I'm not telling itadm what LU to use. I assume it'll use whatever LU is available, but then after I've created a few of these, how do I know what target maps to what LU? I can't find any correlating bit of info.

'stmfadm list-lu -v' lists LU GUID and data file (e.g. /dev/zvol/rdsk/pool/comstar/vol/)
'itadm list-target -v' and 'stmfadm list-target -v' give me the target IQN but no info about what physical volume/LU they map to.

This seems like something you'd commonly want to know, but I seem to be missing something.

JeremiahRo
  • 83
  • 1
  • 5

1 Answers1

3

by default add-view will create a view with the following properties:

View Entry: 0
LUN          :  0
Host group   :  All
Target group :  All

If you want to define which targets map to a view/LU you need to create a target-group:

stmfadm create-tg TG1

then add your target to it:

stmfadm add-tg-member -g TG1 iqn.2010-08.org.illumos:42:4eaa957f-10d1-c40d-fadb-66b66e265e83

Now when you create a view, you need to tell it to use the new target group:

stmfadm add-view -t TG1 600144F077000000000048C62BF00001

The view will now look like this:

View Entry: 0
LUN          :  0
Host group   :  All
Target group :  TG1
    Member: iqn.2010-08.org.illumos:42:4eaa957f-10d1-c40d-fadb-66b66e265e83
        Operational Status: Online
        Provider Name     : iscsit
        Alias             : -
        Protocol          : iSCSI
        Sessions          : 0
Awalias
  • 154
  • 5
  • I don't see how it answers the q-n. First of all, let's say we didn't create target-group as you proposed, how to get the mapping then? – poige May 17 '17 at 15:14