Skip to content

fix(vm-iso-installer): enable NFS live root in initrd - #18649

Open
Izan (IzanVil) wants to merge 1 commit into
microsoft:4.0from
IzanVil:feature/mi-contribucion-izan
Open

fix(vm-iso-installer): enable NFS live root in initrd#18649
Izan (IzanVil) wants to merge 1 commit into
microsoft:4.0from
IzanVil:feature/mi-contribucion-izan

Conversation

@IzanVil

Copy link
Copy Markdown

Fixes #17913

Problem

PXE deployments of the live installer can only fetch the squashfs over HTTP
(root=live:http://...), which pulls the whole image into RAM and forces
installer VMs to be sized at 4 GB. root=live:nfs://... would mount the
squashfs in place, but it does not work today.

The root cause is in url-lib.sh, which registers the NFS handler
conditionally:

command -v nfs_to_var > /dev/null && add_url_handler nfs_fetch_url nfs nfs4

nfs_to_var lives in nfs-lib.sh, shipped by dracut's 95nfs module. kiwi
builds the live initrd with --add ' dmsquash-live livenet pollcdrom ' --omit ' multipath ', so nfs is never added and the handler is never
registered. The kernel NFS modules are in the initrd; only the userspace half
is missing.

Change

Add an /etc/dracut.conf.d drop-in requesting the nfs module. kiwi runs
dracut inside the image root and writes its own 02-livecd.conf in the same
directory, so both files are merged and the add_dracutmodules lists
accumulate (kiwi/builder/live.py, kiwi/boot/image/dracut.py).

The module is only built in if its prerequisites exist at initrd build time.
95nfs's check() requires rpcbind (or portmap) plus rpc.statd,
mount.nfs, mount.nfs4, umount, sed, chmod and chown; if any is
missing the module is skipped silently. umount comes from util-linux and
chmod/chown from coreutils, both already in the image, so this adds
nfs-utils and rpcbind. sed is currently present only as a transitive
dependency — it is listed explicitly so a future dependency change cannot
silently drop the nfs module again.

Verification

Built locally with azldev image build vm-iso-installer (azldev v0.3.0, the
version pinned by .azldev-version; kiwi 10.3.0) and inspected the resulting
initrd from /boot/x86_64/loader/initrd:

  • lsinitrd module list now contains nfs, alongside the unchanged
    dmsquash-live, livenet, pollcdrom, url-lib and network.
    multipath is still omitted.
  • nfs_to_var() is defined in usr/lib/nfs-lib.sh, so the url-lib.sh
    conditional above is satisfied and the nfs/nfs4 URL handlers register.
  • mount.nfs, mount.nfs4, rpc.statd, rpcbind and nfsroot are present,
    along with the 90-parse-nfsroot.sh and 99-nfsroot-cleanup.sh hooks.
  • The image manifest lists nfs-utils, rpcbind, sed, libtirpc,
    libnfsidmap and keyutils.

azldev config dump passes. No component or spec is touched, so no re-render
or lock update is required.

Size impact

Measured against the azl4-dev x86_64 repo metadata: the three added packages
are 0.81 MB of RPMs / 2.21 MB installed, with an upper bound of roughly 8 MB
installed once every possible new transitive dependency is counted — most of
which the image already carries via systemd, dnf5 and anaconda. The built ISO
is 965 MB with an 839 MB squashfs.

Not covered

This verifies that the initrd contains the NFS machinery and that the URL
handler registers. An end-to-end PXE boot against a live NFS server was not
exercised.

PXE deployments can only fetch the live squashfs over HTTP
(root=live:http://...), which pulls the whole ~831 MB image into RAM and
forces installer VMs to be sized at 4 GB. NFS (root=live:nfs://...) would
mount the squashfs in place, but fails: dmsquash-live's url-lib.sh only
registers the NFS handler when nfs_to_var exists, and that helper ships
with dracut's 95nfs module, which kiwi does not add to the live initrd
(it passes --add ' dmsquash-live livenet pollcdrom ' --omit ' multipath ').

Add a /etc/dracut.conf.d drop-in requesting the nfs module. kiwi runs
dracut inside the image root and writes its own 02-livecd.conf there, so
both files are merged and the add_dracutmodules lists accumulate.

The module is only built in if its prerequisites are installed at initrd
build time: 95nfs check() requires rpcbind (or portmap) plus rpc.statd,
mount.nfs, mount.nfs4, umount, sed, chmod and chown. umount comes from
util-linux and chmod/chown from coreutils, both already in the image, so
pull in nfs-utils and rpcbind. sed is currently only present as a
transitive dependency; list it explicitly so a dependency change cannot
silently drop the nfs module again.

Fixes microsoft#17913

Signed-off-by: IzanVil <soyoquienmas@outlook.com>
Copilot AI balanced review requested due to automatic review settings August 27, 2026 23:07
@IzanVil
Izan (IzanVil) requested a review from a team as a code owner August 27, 2026 23:07
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables NFS-hosted live roots for PXE installation, resolving #17913.

Changes:

  • Adds a dracut drop-in enabling the nfs module.
  • Adds required NFS userspace dependencies to the installer image.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
base/images/vm-iso-installer/vm-iso-installer.kiwi Installs the dracut configuration and NFS dependencies.
base/images/vm-iso-installer/dracut-nfs.conf Requests inclusion of dracut’s NFS module.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@IzanVil

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[4.0] Live installer initrd missing NFS dracut module preventing NFS based PXE deployment

2 participants