Require all interfaces to be up before using iscsistart -b
PATCH 1/1 Require all interfaces to be up before using iscsistart -b
If multiple targets are specified in the ibft, iscsistart will log into all of them, possibly using multiple interfaces. Since iscsistart is run indirectly from ifup, require that all interfaces are up before actually logging into the targets.
--- modules.d/95iscsi/iscsiroot.sh | 5 +++++ 1 file changed, 5 insertions(+)
modules.d/95iscsi/iscsiroot.sh +5 -0
@@ -45,6 +45,11 @@ fi handle_firmware() { + # iscsistart -b may use multiple interfaces so only run when + # all are ready. + type all_ifaces_up >/dev/null 2>&1 || . /lib/net-lib.sh + all_ifaces_up || return 1 + if ! [ -e /tmp/iscsistarted-firmware ]; then if ! iscsistart -f; then warn "iscistart: Could not get list of targets from firmware."
Signature · 1 line
1.7.10.4
Patchset imported to github.
Pull request:
<https://github.com/haraldh/dracut/compare/master...dracut-mailing-devs:1431592211-5652-1-git-send-email-ross.lagerwall%40citrix.com>
ping!
Quoted 25 lines · Ross Lagerwall
If multiple targets are specified in the ibft, iscsistart will log into all of them, possibly using multiple interfaces. Since iscsistart is run indirectly from ifup, require that all interfaces are up before actually logging into the targets.
--- modules.d/95iscsi/iscsiroot.sh | 5 +++++ 1 file changed, 5 insertions(+)modules.d/95iscsi/iscsiroot.sh +5
-0@@ -45,6 +45,11 @@ fi handle_firmware() { + # iscsistart -b may use multiple interfaces so only run when + # all are ready. + type all_ifaces_up >/dev/null 2>&1 || . /lib/net-lib.sh + all_ifaces_up || return 1 + if ! [ -e /tmp/iscsistarted-firmware ]; then if ! iscsistart -f; then warn "iscistart: Could not get list of targets from firmware."
Quoted 17 lines · Ross Lagerwall
ping!
Quoted 14 lines · Ross Lagerwall
If multiple targets are specified in the ibft, iscsistart will log into all of them, possibly using multiple interfaces. Since iscsistart is run indirectly from ifup, require that all interfaces are up before actually logging into the targets.
--- modules.d/95iscsi/iscsiroot.sh | 5 +++++ 1 file changed, 5 insertions(+)modules.d/95iscsi/iscsiroot.sh +0
-0@@ -45,6 +45,11 @@ fi
Quoted 11 lines
modules.d/95iscsi/iscsiroot.sh fi · line 55
Quoted 11 lines
modules.d/95iscsi/iscsiroot.sh +5
-0handle_firmware() { + # iscsistart -b may use multiple interfaces so only run when + # all are ready. + type all_ifaces_up >/dev/null 2>&1 || . /lib/net-lib.sh + all_ifaces_up || return 1 + if ! [ -e /tmp/iscsistarted-firmware ]; then if ! iscsistart -f; then warn "iscistart: Could not get list of targets from firmware."
I would love to do that, but users want to have "iscsistart -b" executed regardless of faulty network configuration of interfaces, which are not part of the critical path for root mounting.
So, if you add a "iscsistart -b" in the timeout hook (which is removed, if once succeeded in the normal path), then I guess it will be fine for all.
Quoted 35 lines · Harald Hoyer
Quoted 17 lines · Ross Lagerwall
ping!
Quoted 14 lines · Ross Lagerwall
If multiple targets are specified in the ibft, iscsistart will log into all of them, possibly using multiple interfaces. Since iscsistart is run indirectly from ifup, require that all interfaces are up before actually logging into the targets.
--- modules.d/95iscsi/iscsiroot.sh | 5 +++++ 1 file changed, 5 insertions(+)modules.d/95iscsi/iscsiroot.sh +0
-0@@ -45,6 +45,11 @@ fiQuoted 11 lines
modules.d/95iscsi/iscsiroot.sh fi · line 55
Quoted 11 lines
modules.d/95iscsi/iscsiroot.sh +5
-0handle_firmware() { + # iscsistart -b may use multiple interfaces so only run when + # all are ready. + type all_ifaces_up >/dev/null 2>&1 || . /lib/net-lib.sh + all_ifaces_up || return 1 + if ! [ -e /tmp/iscsistarted-firmware ]; then if ! iscsistart -f; then warn "iscistart: Could not get list of targets from firmware."I would love to do that, but users want to have "iscsistart -b" executed regardless of faulty network configuration of interfaces, which are not part of the critical path for root mounting.
Quoted 3 lines
So, if you add a "iscsistart -b" in the timeout hook (which is removed, if once succeeded in the normal path), then I guess it will be fine for all.
Oh, and ideally I want to see systemd units for iscsistart, or move to iscsid completely.
And iscsid/iscistart would just handle all netlink events.
Quoted 36 lines · Harald Hoyer
Quoted 35 lines · Harald Hoyer
Quoted 17 lines · Ross Lagerwall
ping!
Quoted 14 lines · Ross Lagerwall
If multiple targets are specified in the ibft, iscsistart will log into all of them, possibly using multiple interfaces. Since iscsistart is run indirectly from ifup, require that all interfaces are up before actually logging into the targets.
--- modules.d/95iscsi/iscsiroot.sh | 5 +++++ 1 file changed, 5 insertions(+)modules.d/95iscsi/iscsiroot.sh +0
-0@@ -45,6 +45,11 @@ fiQuoted 11 lines
modules.d/95iscsi/iscsiroot.sh fi · line 55
Quoted 11 lines
modules.d/95iscsi/iscsiroot.sh +5
-0handle_firmware() { + # iscsistart -b may use multiple interfaces so only run when + # all are ready. + type all_ifaces_up >/dev/null 2>&1 || . /lib/net-lib.sh + all_ifaces_up || return 1 + if ! [ -e /tmp/iscsistarted-firmware ]; then if ! iscsistart -f; then warn "iscistart: Could not get list of targets from firmware."I would love to do that, but users want to have "iscsistart -b" executed regardless of faulty network configuration of interfaces, which are not part of the critical path for root mounting.
Quoted 2 lines
Quoted 2 lines
So, if you add a "iscsistart -b" in the timeout hook (which is removed, if once succeeded in the normal path), then I guess it will be fine for all.
That already effectively happens in the existing dracut code due to this line:
initqueue --onetime --timeout "/sbin/iscsiroot dummy '$netroot' '$NEWROOT'"
But the problem is that when multiple NICs are specified in the ibft, "iscsistart -b" hangs for something like 15 minutes trying to use an interface that isn't up so so letting it fallback to the timeout hook doesn't really work for me.
What about adding the following oneliner to the above patch (untested)?
8<-------------------------
modules.d/95iscsi/parse-iscsiroot.sh +1 -1
@@ -62,7 +62,7 @@ if [ -n "$iscsi_firmware" ] ; then [ -z "$netroot" ] && netroot=iscsi: modprobe -b -q iscsi_boot_sysfs 2>/dev/null modprobe -b -q iscsi_ibft - initqueue --onetime --timeout /sbin/iscsiroot dummy "$netroot" "$NEWROOT" + initqueue --onetime --finished /sbin/iscsiroot dummy "$netroot" "$NEWROOT" fi # If it's not iscsi we don't continue
8<-------------------------
So if you have a faulty NIC configuration, you still end up running iscsistart -b eventually.
And if you've already run iscsistart -b (e.g. in the usual case), then the "/tmp/iscsistarted-firmware" flag will prevent you from running it again.
Quoted 7 lines
Quoted 1 line
Oh, and ideally I want to see systemd units for iscsistart, or move to iscsid completely.
And iscsid/iscistart would just handle all netlink events.
Of course :-)
Signature · 1 line
Ross Lagerwall