On 11/01/2016 03:34 PM, The Lee-Man wrote:
> What about having open-iscsi update the node database entry when the TPG
> changes? I'd rather not see iscsid shutting down targets that were not
> specified.
I'm a bit unsure about magically updating the node database behind the
user's back. At the moment certain operations will update the node
database (-m discovery, -m node --op update, etc.), while others will
not (-m node --login). The former is something the user will call
themselves explicitly (hence knowing that the node database is updated)
while the latter isn't.
(Plus, in Debian we keep the database in /etc/iscsi for policy reasons,
because we consider it to be configuration, and /etc could be read-only
at session login time, think virtualization and the such.)
> What I would actually like to solve this problem more generally is a way to
> say "logout of all sessions except 'onboot' sessions", whether or not
> there's a node database entry.
Well, if you want to keep the current semantics for all, we could add
a new keyword ALL (capital letters, current versions reject it, so it
won't break anything) that has this new semantics
Then we'd have:
--logoutall=all current semantics, if session not in DB,
ignore it
--logoutall=ALL new semantics, if session not in DB,
consider it regardless
That retains backwards compatibility while still being reasonably
legible.
That said: if after login the resulting session can result in a
different TPGT, I would want to implement a two-step matching of
sessions regardless.
Example:
- target: iqn.dummy
- portal: 127.0.0.1:3260
- tpgt at target: 42
- tpgt in node database: 1
iscsiadm -m node -T iqn.dummy -p 127.0.0.1:3260 --login
=> logs into target
iscsiadm -m node -T iqn.dummy -p 127.0.0.1:3260 --logout
=> fails at the moment (IIRC)
I would therefore in addition want to implement session matching in
the node database in the following way (but for running sessions
only):
- if exact combination of <target, ip, port, tgpt> is available, use
that
- if <target, ip, port> has a _unique_ entry with a different tpgt,
use that instead
In that case, --logoutall=all (lowercase) would still match the
session (because it effectively is in the database), as well as the
manual logout command I presented above.
Would you agree to both of these changes? I'd be willing to write and
submit patches for that.
Regards,
Christian
--
You received this message because you are subscribed to the Google Groups
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.