Boot processing of systemd running on the instance stopped network-online.target reach if /etc/fstab contains NFS entry.
Environment
- An instance is on Azure, and the OS of the instance is Red Hat Enterprise Linux 8 and the later
cloud-init.service
is active/etc/fstab
file containsNFSv3
mount entry or/etc/fstab
file containsNFSv4
mount entry which is falling back and trying to mountNFSv3
Issue
- Instances which
cloud-init
is enabled will not boot properly. It hangs during boot.
Resolution
-
This issue is related to bz#2081114. There is no fix for the issue.
-
This issue is noted in the RHEL release note as Known issue below.
-
There are 2 workarounds. The details are described in the Workaround section.
Workaround
There are 2 patterns.
-
Pattern 1:
SpecifyNFSv4
mount option for an NFS entry in/etc/fstab
- unmount the NFS
# umount <MOUNTPOINT>
-
Append
NFSv4
option in/etc/fstab
Appendvers=4
ornfsvers=4
mount option for a targeted entry in/etc/fstab
-
Mount NFS
# mount -a
-
Pattern 2:
Appendnoauto
mount option for anNFSv3
entry in/etc/fstab
and creating custom modules using DropIn-
Append
noauto
mount option for anNFSv3
entry in/etc/fstab
-
Confirm the unit file name (
<UNIT_NAME>
) corresponding to the mount point.
<UNIT_NAME>
is named xxx.mount.
# systemd-escape -p --suffix=mount <MOUNTPOINT> <UNIT_NAME>
- Create the directory
/etc/systemd/system/remote-fs.target.d/
if it does not exist.
# mkdir /etc/systemd/system/remote-fs.target.d/
- Create
/etc/systemd/system/remote-fs.target.d/50-Requires.conf
with the following contents.
(<UNIT_NAME> is the name (xxx.mount) from step 2) [Unit] Requires=<UNIT_NAME>
- Execute
systemctl daemon-reload
to apply the configuration to systemd.
# systemctl daemon-reload
- Verify the settings are applied.
# systemctl show -p DropInPaths,Requires remote-fs.target Requires=<UNIT_NAME> DropInPaths=/etc/systemd/system/remote-fs.target.d/50-Requires.conf
If
Requires
andDoropInPaths
appear in the output above, they are set correctly.- Reboot the instance and then verify the
NFSv3
entry is automatically mounted.
-
Root Cause
- If the
cloud-init
is enabled in the VM on Azure,rpc-statd-notify.service
andrpc-statd.service
starts before the network gets ready.
Therefore,rpc-statd-notify.service
andrpc-statd.service
stucks while enablingNFSv3
, and the system boot stops. NFSv3
requiresrpc-statd-notify.service
andrpc-statd.service
, so the issue happens onNFSv3
.NFSv4
doesn't require them, however, if the user configsNFSv4
to fall back toNFSv3
, this issue may happen onNFSv4
as well.
Diagnostic Steps
-
See
/usr/lib/systemd/system/cloud-init.service
on the instance to confirmBefore=network-online.target
is set.[Unit] Description=Initial cloud-init job (metadata service crawler) ..snip.. Before=network-online.target ..snip..
-
See
/etc/cloud/cloud.cfg
on instance to confirmcloud-init.service
executescloud-init
modules.
For Azure VM, cloud-init mounts module runs viacloud-init.service
, according to the requirements in Microsoft's documentation...snip.. cloud_init_modules: - disk_setup - mounts ..snip..
-
See
/usr/lib/systemd/system/rpc-statd.service
on the instance to confirmAfter=network-online.target
is set.[Unit] Description=NFS status monitor for NFSv2/3 locking. //this description is wrong NFSv4 is right DefaultDependencies=no Conflicts=umount.target Requires=nss-lookup.target rpcbind.socket Wants=network-online.target After=network-online.target nss-lookup.target rpcbind.socket ..snip..
-
See
/etc/fstab
on instance to confirmNFSv4
ornoauto
mount option for an NFS entry is not specified .
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments