nvmf-autoconnect.service Not working

Ironhide526

New Member
Apr 19, 2025
2
0
1
I have configured shared storage for Proxmox using a Dell PowerStore 1200T. The protocol in use is NVMe over TCP. Everything works fine, except the connection does not persist after a reboot.

discovery.conf Configuration:

--transport=tcp --traddr=192.168.5.5 --trsvcid=4420
--transport=tcp --traddr=192.168.5.6 --trsvcid=4420
--transport=tcp --traddr=192.168.6.5 --trsvcid=4420
--transport=tcp --traddr=192.168.6.6 --trsvcid=4420


nvmf-autoconnect.service Configuration:


[Unit]
Description=Connect NVMe-oF subsystems automatically during boot
ConditionPathExists=/etc/nvme/discovery.conf
After=network-online.target
Before=remote-fs-pre.target

[Service]
Type=oneshot
ExecStartPre=/sbin/modprobe nvme_tcp
ExecStart=/usr/sbin/nvme connect-all

[Install]
WantedBy=default.target


The issue appears to be that the service is ignoring After=network-online.target and attempts to connect before the network is fully up.

I found a similar thread in the forums, but there were no answers.

Maybe there's a known bug that I'm not aware of.

Proxmox version: 8.4.1 (Latest)
 
Hi,

this doesn't really have anything to do with Proxmox VE itself, but rather is normal Debian/systemd administration.

The issue appears to be that the service is ignoring After=network-online.target and attempts to connect before the network is fully up.
In any case, you probably also want Wants=network-online.target.

After= is a "ordering-only" directive and does not imply any dependencies on other services.

I'd suggest reading https://systemd.io/NETWORK_ONLINE/, esp. the paragraph How do I make sure that my service starts after the network is really online?
 
Hi, thanks for the tip. However, I have already tried that. I added:
Wants=network-online.target to nvmf-autoconnect.service configuration


I also enabled the systemd-networkd-wait-online.service, but this service is failing at boot with the message: "Timeout occurred while waiting for network connectivity."

I modified the service's ExecStart to wait for specific interfaces:

ExecStart=/lib/systemd/systemd-networkd-wait-online --interface=vmbr1:routable --interface=vmbr2:routable

But it still fails during boot. Then, I removed the ":routable" part, and the service started successfully during boot, but the network storage still failed to attach automatically.