astro / microvm.nix

NixOS MicroVMs
https://astro.github.io/microvm.nix/
MIT License
1.25k stars 94 forks source link

Futher occasional boot failures due to module load order #186

Closed oddlama closed 8 months ago

oddlama commented 8 months ago

While I though I fixed the boot order issues from https://github.com/astro/microvm.nix/issues/114 in https://github.com/astro/microvm.nix/pull/117, it unfortunately looks like there are still some left. In the past days I've had an increasing amount of issues that prevent a particular microvm from coming up, due to overlayfs not being available.

Sometimes microvms with a writable store overlay won't come up because the overlayfs lower dir is not available. (The message could be interpreted as saying that the overlayfs module is missing, but this is not the case)

Jan 18 14:04:36 sire-paperless mount[136]: mount: /sysroot/nix/store: special device overlay does not exist.
Jan 18 14:04:36 sire-paperless mount[136]:        dmesg(1) may have more information after failed mount system call.
Jan 18 14:04:36 sire-paperless kernel: overlayfs: failed to resolve '/sysroot/nix/.ro-store': -2

So for some reason /sysroot/nix/store is mounted before /sysroot/nix/.ro-store is available, which should never happen because it looks like there is already a dependency here:

https://github.com/astro/microvm.nix/blob/088ba565537eaef1041a87be5a44ca0daa4e1908/nixos-modules/microvm/mounts.nix#L142

But as it turns out, this is missing a /sysroot prefix. Will do a quick PR.

I'm actually quite curious how nobody else seems to be running into these issues, since they should affect everyone using a writable store overlay if I'm not mistaken... Guess I'm just a bit lucky. :P