On 12/4/22 05:02, Wenchao Hao wrote:
On Thu, Dec 1, 2022 at 3:53 AM Lee Duncan <[email protected]> wrote:
...
Let me start by saying I agree with you now, that there *is* an issue.
But your test was flawed.
After you log into a target, changing the Node database does nothing.
The node database is only referenced with you login using it, e.g.
"iscsiadm -m node ... -l".
But even if you logged out and then back into the target, thereby using
the updated Node DB entries, it would not have worked.
For one thing, "iscsiadm -m session -u" just logs out of all sessions,
as far as I can see, based on testing and code inspection. So that is a
problem.
Note that the iscsi.service systemd service file on SLES does "not" do
that. It instead logs of of "manual" and "automatic" session, but only
ones that are listed in the Node database.
And as you pointed out, any knowledge iscsid has of existing sessions is
lost if the daemmon dies or is stopped, then restarted. At that point,
the only knowledge is has about each session is what it finds in sysfs.
I have done some testing with your new kernel change that adds a
"node_startup" sysfs string attribute to session data. I modified
open-iscsi to pass in the node startup value, and that's a good start.
The next step is adding a "startup" value in the session structure,
filling it in from sysfs (or current state), and refusing to logout out
of sesions that have this set to "onboot", which all sounds fairly
simple. I also want to test with "iscsiadm -m fw -l", which is what I
believe is used when booting from software iscsi (i.e. iBFT).
Have you already worked on the open-iscsi side of this? No reason for
duplicate development.
--
Lee Duncan
Sorry I missed this message, I have modified open-iscsi to work
with this sysfs interface. But I think we do not need this any more
because the safe logout can avoid disks being removed.
Checking holders and if disk is mounted before logout seems enough,
so ignore this discussion.
Thank you very much for your reply.
I have some philosophical issues with using safe_logout.
It is off by default, which implies to me that it has overhead. If I'm
doing a lot of iscsi session start/stops, I don't want the overhead.
Otherwise, why not just use it all the time.
Also, it only checks for mounts. What about if some process has the
device open but isn't using it for a filesystem?
And since it has overhead, I'd rather just use it on root iscsi volumes.
I have not had a single problem report from folks that have ended a
session by accident that is mounted on. Since ending your root volume
iscsi session is fatal, I _would_ like to proactively avoid that
possibility. So I want to only set this attribute on iscsi root volumes,
which means it'd have to be a per-node (or per-session) attribute, not a
global one.
Lastly, I can imagine a time when I want to override safe_logout, say if
some process is stuck. So it'd be nice to have a "--force" option to end
a session even if safe_logout is set.
But as I said, these objections are philosophical/theoretical.
And for the record, I like the idea of tracking the "start mode" of
sessions. Right now, if I list the iscsi sessions, I can't tell which
ones where started from firmware, which were started in the initrd, and
which were just manually started. So tracking (and being able to
display) the startup mode would only be a good thing IMHO.
--
Lee D
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/open-iscsi/181bdb6a-fbaf-1e18-9d08-4bbabf467321%40suse.com.