Hi Mike,
 
The problem I have is that if a client does a SendTargets TEXT command, the 
comstar iscsi port returns all targets that the host hosts. Do you in your 
environment have a way to limit the targets visible to the client (specifically 
when doing target discovery via SendTargets)?
 
Lets say I have a target for vlan 100 and another target for vlan 200. 
 
>itadm create-tpg tpg_100 192.168.100.1
>itadm create-tpg tpg_200 192.168.200.1
 
>itadm create-target -n iqn.1990-01.edu.amherst:target100 -t tpg_100 
>itadm create-target -n iqn.1990-01.edu.amherst:target200 -t tpg_200
 
Let's take a linux open-iscsi client and do a discovery via sendtargets (the 
portal IP could be any IP that the target has been configured with)
 
>iscsiadm --mode discovery --type sendtargets --portal 192.168.100.1
192.168.100.1:3260,2 iqn.1990-01.edu.amherst:target100 
192.168.200.1:3260,2 iqn.1990-01.edu.amherst:target200
 
Looking at the source code of comstar/port/iscsit/iscsi_text.c line 550 there 
are comments in the code that indicate
 
/*
 * Add all the targets to the response list.
 */
 
Looking at the code, all targets are enumerated and only those that are online 
or are about to become online are emitted to the initiator.
 
The algorithm for this should be:
 
Remember the current initiator name contacting us. Enumerate all host groups 
(stmfadm) and find a single host group where the initiator is a member, now we 
have a host group to key on.
 
Enumerate all views (stmfadm) and look at those where the host group matches 
the one we found before. If we have that, look at the target group of that view 
and enumerate over the targets of the target group. Those targets are to be 
visible. As you enumerate all views and perform these steps, accumulate the 
target list.
 
Now emit the resulting target list  - the initiator would only see those 
targets that the initiator has been configured to see.
 
Steffen
 
_______________________________________________
storage-discuss mailing list
storage-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/storage-discuss

Reply via email to