fix(vm-iso-installer): enable NFS live root in initrd - #18649
Open
Izan (IzanVil) wants to merge 1 commit into
Open
fix(vm-iso-installer): enable NFS live root in initrd#18649Izan (IzanVil) wants to merge 1 commit into
Izan (IzanVil) wants to merge 1 commit into
Conversation
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>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Enables NFS-hosted live roots for PXE installation, resolving #17913.
Changes:
- Adds a dracut drop-in enabling the
nfsmodule. - 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.
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 forcesinstaller VMs to be sized at 4 GB.
root=live:nfs://...would mount thesquashfs in place, but it does not work today.
The root cause is in
url-lib.sh, which registers the NFS handlerconditionally:
nfs_to_varlives innfs-lib.sh, shipped by dracut's95nfsmodule. kiwibuilds the live initrd with
--add ' dmsquash-live livenet pollcdrom ' --omit ' multipath ', sonfsis never added and the handler is neverregistered. The kernel NFS modules are in the initrd; only the userspace half
is missing.
Change
Add an
/etc/dracut.conf.ddrop-in requesting thenfsmodule. kiwi runsdracut inside the image root and writes its own
02-livecd.confin the samedirectory, so both files are merged and the
add_dracutmoduleslistsaccumulate (
kiwi/builder/live.py,kiwi/boot/image/dracut.py).The module is only built in if its prerequisites exist at initrd build time.
95nfs'scheck()requiresrpcbind(orportmap) plusrpc.statd,mount.nfs,mount.nfs4,umount,sed,chmodandchown; if any ismissing the module is skipped silently.
umountcomes fromutil-linuxandchmod/chownfromcoreutils, both already in the image, so this addsnfs-utilsandrpcbind.sedis currently present only as a transitivedependency — it is listed explicitly so a future dependency change cannot
silently drop the
nfsmodule again.Verification
Built locally with
azldev image build vm-iso-installer(azldevv0.3.0, theversion pinned by
.azldev-version; kiwi 10.3.0) and inspected the resultinginitrd from
/boot/x86_64/loader/initrd:lsinitrdmodule list now containsnfs, alongside the unchangeddmsquash-live,livenet,pollcdrom,url-libandnetwork.multipathis still omitted.nfs_to_var()is defined inusr/lib/nfs-lib.sh, so theurl-lib.shconditional above is satisfied and the
nfs/nfs4URL handlers register.mount.nfs,mount.nfs4,rpc.statd,rpcbindandnfsrootare present,along with the
90-parse-nfsroot.shand99-nfsroot-cleanup.shhooks.nfs-utils,rpcbind,sed,libtirpc,libnfsidmapandkeyutils.azldev config dumppasses. No component or spec is touched, so no re-renderor lock update is required.
Size impact
Measured against the
azl4-devx86_64 repo metadata: the three added packagesare 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.