| 7 Jul 2023 |
oddlama | I've run into a race condition when starting vms (microvm.nix), where guests have a filesystem declared as neededForBoot = true; type = "virtiofs";. It looks like the kernel module required to load these filesystems is just inserted via systemd-modules-load which has no defined ordering with regards to the file system mount units. Thus, it sometimes happens to late and the mounting fails. | 00:38:55 |
oddlama | The module is available in the initramfs though, so I'm not sure whether this is a misconfiguration in microvm.nix or whether there is a missing dependency here. | 00:38:57 |
oddlama | Any ideas? | 00:39:02 |
@elvishjerricco:matrix.org | Well that's especially odd because mounting an FS should implicitly load its kernel module if it isn't loaded already | 00:40:00 |
@elvishjerricco:matrix.org | so ordering with systemd-modules-load shouldn't matter | 00:40:15 |
@elvishjerricco:matrix.org | in fact I don't even think we load FS drivers with that | 00:40:24 |
oddlama | I had a similar thought, but it's definitely an issue with the modules. If you enter the emergency shell you can just mount them without any issue | 00:40:52 |
@elvishjerricco:matrix.org | Hm. Would love to see a minimal repro nixos tests | 00:41:08 |
@elvishjerricco:matrix.org | * Hm. Would love to see a minimal repro nixos test | 00:41:09 |
@elvishjerricco:matrix.org | regardless | 00:41:14 |
@elvishjerricco:matrix.org | you can do x-systemd.after=systemd-modules-load.service as a workaround | 00:41:30 |
oddlama | It's especially hard to reproduce, because I can only reliably hit the bug when restarting 6 vms at once, and even then only 20% of the time | 00:41:46 |
@elvishjerricco:matrix.org | luckily nixos tests let you define arbitrarily many machines and start them all with start_all() :) | 00:42:26 |