[Stgt-devel] [Scst-devel] Integration of SCST in themainstreamLinux kernel

FUJITA Tomonori tomof
Thu Mar 13 16:47:23 CET 2008


On Thu, 13 Mar 2008 16:23:18 +0100
Tomasz Chmielewski <mangoo at wpkg.org> wrote:

> FUJITA Tomonori schrieb:
> 
> (...)
> 
> >>> I could make it as the startup (boot) option though I don't like it
> >>> either but I think that it's less problematic to set the default state
> >>> to 'offline'.
> >> Either default to offline (bad for existing users) or give a startup 
> > 
> > Not only for existing users. People dislike extra operations.
> > 
> > I've used several commercial iSCSI target systems. All I need to do are
> > setting up security (which initiators can connect) and luns with them.
> > 
> > 
> >> option to tgtd (better). There is no other way, I guess (other than 
> >> making it compile-time option, which is really bad).
> > 
> > There is another option. If tgtd has no targets, then tgtd closes a
> > connection instead of sending a response. So you can change the state
> > to offline, configure targets and then change the state to running.
> > 
> > Try this patch (against the current git head).
> 
> No, this won't work reliably if you have more than one target.
> 
> Let's say you have these targets; initiators connected to it:
> 
> tgtadm --lld iscsi --op new --mode target --tid 1 -T 
> iqn.2008-03.com.example:san.target1
> tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b 
> /dev/san/target1
> tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
> 
> tgtadm --lld iscsi --op new --mode target --tid 2 -T 
> iqn.2008-03.com.example:san.target2
> tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 2 -b 
> /dev/san/target2
> tgtadm --lld iscsi --op bind --mode target --tid 2 -I ALL
> 
> 
> You just upgraded and restarted your target without disconnecting the 
> initiators. You have to go through these steps:
> 
> target              initiator
> -----------------------------------
> not started         trying to reconnect
> start tgtd          trying to reconnect
> sleep 2s            trying to reconnect
> nothing configured  login I/O error - non fatal
> configure target1   conn to target1 OK
> no such target      conn to target2 FAIL
>                      I/O error to target2
> configure target2   too late, fatal, we lost it

You don't understand how to use it.

1. start tgtd.
2. change the system state to offline.
3. do whatever you want (create new targets and add luns).
4. change the system state to running.


> With one target it will never fail.
> With two targets it is not very likely to fail.
> 
> With lots of targets and initiators the things will fail, and a user 
> which is not familiar with technicals will say "it fails randomly".
> 
> So I prefer the previous version of the patch, where the target is 
> explicitly in offline state (with "tgtd --offline" flag, perhaps).
> 
> 
> Or, is it possible not to fail connections to non-existing targets, but 
> to answer that the (non-existing, not-yet-configured) target is 
> offlined? Or will it be against RFCs?

I don't think so.

BTW, as I explained again and again, IIRC, RFC doesn't say that
initiators need to reconnect in your situation. Your scheme works for
open-iscsi now, but it could be broken anytime.



More information about the stgt mailing list