[Touch-packages] [Bug 1876670] [NEW] nfs does not mount at boot with bridge

2020-05-04 Thread Jonathan Van den Broeck
Public bug reported:

I am running a Ubuntu 20.04 server with lxd and kvm/qemu. 
I try to connect a nfs share at boot. It is working while I do not configure 
any bridge with netplan. I am creating directly a systemd service for the NFS 
mount but I have the same problem if I edit the fstab file.

#/etc/systemd/system/mnt-nas.mount
[Unit]
Description=NAS devices
After=network.target

[Mount]
What=192.168.1.20:/volume2/media
Where=/mnt/nas
Type=nfs
Options=_netdev,auto

[Install]
WantedBy=multi-user.target

## TEST WITHOUT BRIDGE

#/etc/netplan/01-netcfg.yaml 
network:
  version: 2
  renderer: networkd
  ethernets:
eno1:
  dhcp4: yes

root@bowser:~# ip a
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group 
default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eno1:  mtu 1500 qdisc fq_codel state UP 
group default qlen 1000
link/ether f8:75:a4:00:be:ad brd ff:ff:ff:ff:ff:ff
inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eno1
   valid_lft 86244sec preferred_lft 86244sec
inet6 fe80::fa75:a4ff:fe00:bead/64 scope link 
   valid_lft forever preferred_lft forever
3: wlp1s0:  mtu 1500 qdisc noop state DOWN group default 
qlen 1000
link/ether 60:f2:62:38:d7:c2 brd ff:ff:ff:ff:ff:ff

root@bowser:~# journalctl -b
...
May 04 08:58:08 bowser systemd-networkd[535]: eno1: Gained carrier
May 04 08:58:08 bowser kernel: e1000e: eno1 NIC Link is Up 1000 Mbps Full 
Duplex, Flow Control: None
May 04 08:58:08 bowser kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eno1: link 
becomes ready
May 04 08:58:08 bowser systemd[1]: systemd-rfkill.service: Succeeded.
May 04 08:58:08 bowser set-cpufreq[795]: Setting powersave scheduler for all 
CPUs
May 04 08:58:08 bowser systemd[1]: ondemand.service: Succeeded.
May 04 08:58:08 bowser systemd[1]: dmesg.service: Succeeded.
May 04 08:58:09 bowser systemd-networkd[535]: eno1: Gained IPv6LL
May 04 08:58:09 bowser systemd-timesyncd[757]: Network configuration changed, 
trying to establish connection.
May 04 08:58:10 bowser systemd-networkd[535]: eno1: DHCPv4 address 
192.168.1.100/24 via 192.168.1.1
May 04 08:58:10 bowser systemd-timesyncd[757]: Network configuration changed, 
trying to establish connection.
May 04 08:58:10 bowser systemd-timesyncd[757]: Network configuration changed, 
trying to establish connection.
May 04 08:58:10 bowser systemd-timesyncd[757]: Network configuration changed, 
trying to establish connection.
May 04 08:58:10 bowser systemd-networkd-wait-online[611]: managing: eno1
May 04 08:58:10 bowser systemd[1]: Finished Wait for Network to be Configured.
May 04 08:58:10 bowser systemd[1]: Reached target Network is Online.
May 04 08:58:10 bowser systemd[1]: Condition check resulted in Login to default 
iSCSI targets being skipped.
May 04 08:58:10 bowser systemd[1]: Reached target Remote File Systems (Pre).
May 04 08:58:10 bowser systemd[1]: Mounting NAS devices...
May 04 08:58:10 bowser systemd[1]: Starting Availability of block devices...
May 04 08:58:10 bowser systemd[1]: Condition check resulted in Pollinate to 
seed the pseudo random number generator being skipped.
May 04 08:58:10 bowser systemd[1]: Starting OpenBSD Secure Shell server...
May 04 08:58:10 bowser systemd[1]: Finished Availability of block devices.
May 04 08:58:10 bowser kernel: FS-Cache: Loaded
May 04 08:58:10 bowser sshd[952]: Server listening on 0.0.0.0 port 22.
May 04 08:58:10 bowser sshd[952]: Server listening on :: port 22.
May 04 08:58:10 bowser systemd[1]: Started OpenBSD Secure Shell server.
May 04 08:58:10 bowser kernel: FS-Cache: Netfs 'nfs' registered for caching
May 04 08:58:10 bowser kernel: NFS: Registering the id_resolver key type
May 04 08:58:10 bowser kernel: Key type id_resolver registered
May 04 08:58:10 bowser kernel: Key type id_legacy registered
May 04 08:58:10 bowser systemd[1]: /lib/systemd/system/rpc-statd.service:16: 
PIDFile= references a path below legacy directory /var/run/, updating 
/var/run/rpc.statd.pid → /run/rpc.statd.pid; please update the unit file 
accordingly.
May 04 08:58:10 bowser systemd[1]: Starting Preprocess NFS configuration...
May 04 08:58:10 bowser systemd[1]: nfs-config.service: Succeeded.
May 04 08:58:10 bowser systemd[1]: Finished Preprocess NFS configuration.
May 04 08:58:10 bowser systemd[1]: Starting Notify NFS peers of a restart...
May 04 08:58:10 bowser systemd[1]: Starting NFS status monitor for NFSv2/3 
locking
May 04 08:58:10 bowser sm-notify[962]: Version 1.3.3 starting
May 04 08:58:10 bowser systemd[1]: rpc-statd-notify.service: Succeeded.
May 04 08:58:10 bowser systemd[1]: Started Notify NFS peers of a restart.
May 04 08:58:10 bowser rpc.statd[964]: Version 1.3.3 starting
May 04 08:58:10 bowser rpc.statd[964]: Flags: TI-RPC
May 04 08:58:10 bowser systemd[1]: Started NFS status monitor for NFSv2/3 
locking..
May 04 08:58:10 

[Touch-packages] [Bug 1876670] Re: nfs does not mount at boot with bridge

2020-05-06 Thread Jonathan Van den Broeck
Same probleme with the modification you suggest.

root@bowser:~# cat /etc/systemd/system/mnt-nas.mount
[Unit]
Description=NAS devices
After=network-online.target

[Mount]
What=192.168.1.20:/volume2/media
Where=/mnt/nas
Type=nfs
Options=_netdev,auto

[Install]
WantedBy=multi-user.target
root@bowser:~# systemctl status mnt-nas.mount

● mnt-nas.mount - NAS devices
 Loaded: loaded (/etc/systemd/system/mnt-nas.mount; enabled; vendor preset: 
enabled)
 Active: failed (Result: exit-code) since Wed 2020-05-06 17:35:46 CEST; 
4min 59s ago
  Where: /mnt/nas
   What: 192.168.1.20:/volume2/media

May 06 17:35:45 bowser systemd[1]: Mounting NAS devices...
May 06 17:35:46 bowser mount[751]: mount.nfs: Network is unreachable
May 06 17:35:46 bowser systemd[1]: mnt-nas.mount: Mount process exited, 
code=exited, status=32/n/a
May 06 17:35:46 bowser systemd[1]: mnt-nas.mount: Failed with result 
'exit-code'.
May 06 17:35:46 bowser systemd[1]: Failed to mount NAS devices.

I also have done some more test. I only have this problem on a bare
metal installation (Lenovo M720q). If I do the same configuration on a
virtual machine, I do not have the problem. I do not have the problem
with a fedora server installation on bare metal.

I do not have enough knowledge to troubleshoot this problem but I am
fully available if you have some commands you want me to try.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1876670

Title:
  nfs does not mount at boot with bridge

Status in systemd package in Ubuntu:
  Incomplete

Bug description:
  I am running a Ubuntu 20.04 server with lxd and kvm/qemu. 
  I try to connect a nfs share at boot. It is working while I do not configure 
any bridge with netplan. I am creating directly a systemd service for the NFS 
mount but I have the same problem if I edit the fstab file.

  #/etc/systemd/system/mnt-nas.mount
  [Unit]
  Description=NAS devices
  After=network.target

  [Mount]
  What=192.168.1.20:/volume2/media
  Where=/mnt/nas
  Type=nfs
  Options=_netdev,auto

  [Install]
  WantedBy=multi-user.target

  ## TEST WITHOUT BRIDGE

  #/etc/netplan/01-netcfg.yaml 
  network:
version: 2
renderer: networkd
ethernets:
  eno1:
dhcp4: yes

  root@bowser:~# ip a
  1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group 
default qlen 1000
  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  inet 127.0.0.1/8 scope host lo
 valid_lft forever preferred_lft forever
  inet6 ::1/128 scope host 
 valid_lft forever preferred_lft forever
  2: eno1:  mtu 1500 qdisc fq_codel state UP 
group default qlen 1000
  link/ether f8:75:a4:00:be:ad brd ff:ff:ff:ff:ff:ff
  inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic eno1
 valid_lft 86244sec preferred_lft 86244sec
  inet6 fe80::fa75:a4ff:fe00:bead/64 scope link 
 valid_lft forever preferred_lft forever
  3: wlp1s0:  mtu 1500 qdisc noop state DOWN group default 
qlen 1000
  link/ether 60:f2:62:38:d7:c2 brd ff:ff:ff:ff:ff:ff

  root@bowser:~# journalctl -b
  ...
  May 04 08:58:08 bowser systemd-networkd[535]: eno1: Gained carrier
  May 04 08:58:08 bowser kernel: e1000e: eno1 NIC Link is Up 1000 Mbps Full 
Duplex, Flow Control: None
  May 04 08:58:08 bowser kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eno1: link 
becomes ready
  May 04 08:58:08 bowser systemd[1]: systemd-rfkill.service: Succeeded.
  May 04 08:58:08 bowser set-cpufreq[795]: Setting powersave scheduler for all 
CPUs
  May 04 08:58:08 bowser systemd[1]: ondemand.service: Succeeded.
  May 04 08:58:08 bowser systemd[1]: dmesg.service: Succeeded.
  May 04 08:58:09 bowser systemd-networkd[535]: eno1: Gained IPv6LL
  May 04 08:58:09 bowser systemd-timesyncd[757]: Network configuration changed, 
trying to establish connection.
  May 04 08:58:10 bowser systemd-networkd[535]: eno1: DHCPv4 address 
192.168.1.100/24 via 192.168.1.1
  May 04 08:58:10 bowser systemd-timesyncd[757]: Network configuration changed, 
trying to establish connection.
  May 04 08:58:10 bowser systemd-timesyncd[757]: Network configuration changed, 
trying to establish connection.
  May 04 08:58:10 bowser systemd-timesyncd[757]: Network configuration changed, 
trying to establish connection.
  May 04 08:58:10 bowser systemd-networkd-wait-online[611]: managing: eno1
  May 04 08:58:10 bowser systemd[1]: Finished Wait for Network to be Configured.
  May 04 08:58:10 bowser systemd[1]: Reached target Network is Online.
  May 04 08:58:10 bowser systemd[1]: Condition check resulted in Login to 
default iSCSI targets being skipped.
  May 04 08:58:10 bowser systemd[1]: Reached target Remote File Systems (Pre).
  May 04 08:58:10 bowser systemd[1]: Mounting NAS devices...
  May 04 08:58:10 bowser systemd[1]: Starting Availability of block devices...
  May 04 08:58:10 bowser systemd[1]: Condition check resulted in Pollinate to 
seed the