You are not logged in.

#1 2020-09-19 19:39:12

alexxedo
Member
Registered: 2019-10-16
Posts: 6

[SOLVED] Unable to login on iscsid target at boot

Hi all

I am trying to install an arch based system on a machine which needs to connect to a iscsi target at boot, I am able to do that manually after the boot.
If I activate the iscsi target at boot I can see that the iscsid connection is initiated before the network card have gotten its address through the DHCP thus failing (my /dev/sdX devices are not available).
I tried to make the iscsid to wait for the network to be ready (ie having received its IP address) by enabling the service systemd-networkd-wait-online but without success.

Does one know what I am missing here ?
I didn't succeed to make the iscsid daemon to retry a few seconds after ever

Regards

Last edited by alexxedo (2020-09-20 10:02:06)

Offline

#2 2020-09-20 10:01:28

alexxedo
Member
Registered: 2019-10-16
Posts: 6

Re: [SOLVED] Unable to login on iscsid target at boot

Ok I solved the issue:

1. The open-iscsi package (2.1.2-1) has a small issue, It install a iscsi.service file refering to a iscsi-init.service that is missing.
    To solve the issue, edit the file (/usr/lib/systemd/system/iscsi.service) and remove the iscsi-init.service from the Requires directive.
2. Enable the {your_net_manager}-wait-online.service to make a service waiting for the network to be up with (systemctl enable {your_net_manager}--wait-online.service
3. Edit the file  /usr/lib/systemd/system/remote-fs.target and add "After=network-online.target" and "Wants=network-online.target" in the [Unit] part. This will force all remote fs tasks to wait for the network to be online before starting

Offline

#3 2020-10-24 17:51:56

ectospasm
Member
Registered: 2015-08-28
Posts: 303

Re: [SOLVED] Unable to login on iscsid target at boot

I still couldn't get this working, even after NetworkManager-wait-online.service was enabled (on my system it's enabled by default).  Turns out by default NetworkManager-wait-online.service doesn't actually wait until the network is online, it just waits until NetworkManager has started.  This is what I did to fix it:

systemctl edit --full NetworkManager-wait-online.service

Change this:

ExecStart=/usr/bin/nm-online -s -q

To this:

ExecStart=/usr/bin/nm-online -q

From the nm-online man page:

man nm-online wrote:

       -s | --wait-for-startup
           Wait for NetworkManager startup to complete, rather than waiting for network connectivity specifically. Startup is considered complete once
           NetworkManager has activated (or attempted to activate) every auto-activate connection which is available given the current network state. This
           corresponds to the moment when NetworkManager logs "startup complete". This mode is generally only useful at boot time. After startup has
           completed, nm-online -s will just return immediately, regardless of the current network state.

           There are various ways to affect when startup complete is reached. For example, by setting a connection profile to autoconnect, such a profile
           possibly will activate during startup and thus delay startup complete being reached. Also, a profile is considered ready when it fully reached
           the logical connected state in NetworkManager. That means, properties like ipv4.may-fail and ipv6.may-fail affect whether a certain address
           family is required. Also, the connection property connection.wait-device-timeout affects whether to wait for the driver to detect a certain
           device. Generally, a failure of NetworkManager-wait-online.service indicates a configuration error, where NetworkManager won't be able to reach
           the desired connectivity state during startup. An example for that are bridge or bond master profiles, that get autoconnected but without
           activating any slaves. Such master devices hang in activating state indefinitely, and cause NetworkManager-wait-online.service to fail.

My VM now boots really fast, and all the iscsi target disks are available to it!

Offline

Board footer

Powered by FluxBB