Skip to content

nixos/qemu-vm: fix diskless VMs#228047

Merged
RaitoBezarius merged 1 commit intoNixOS:masterfrom
RaitoBezarius:diskless-vm
May 5, 2023
Merged

nixos/qemu-vm: fix diskless VMs#228047
RaitoBezarius merged 1 commit intoNixOS:masterfrom
RaitoBezarius:diskless-vm

Conversation

@RaitoBezarius
Copy link
Member

Description of changes

Previously, it was possible to run with a tmpfs / with virtualisation.diskImage = null;, this was likely broken by my changes in 4b4e4c3.

It is reintroduced by disabling properly the bootloader for now, as it is complicated to make it work with.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Apr 24, 2023
Copy link
Member

@alyssais alyssais left a comment

Choose a reason for hiding this comment

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

This fixes my NixOS test that uses virtualisation.diskImage = null, thanks!

Copy link
Member

@alyssais alyssais left a comment

Choose a reason for hiding this comment

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

Actually this appears to have broken other things. A NixOS test node with no options set now says "error: No device specified for mount point ‘/’.".

Previously, it was possible to run with a tmpfs / with
`virtualisation.diskImage = null;`, this was likely broken by my changes
in 4b4e4c3.

It is reintroduced by disabling properly the bootloader for now, as it
is complicated to make it work with.
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 25, 2023
@RaitoBezarius
Copy link
Member Author

Running an evaluation here https://hydra.nixos.org/jobset/nixos/python-test-refactoring with merge-base.

@RaitoBezarius
Copy link
Member Author

Evaluation shows no extra failures, beyond existing ones.

@RaitoBezarius RaitoBezarius merged commit 1ab4d7d into NixOS:master May 5, 2023
@vcunat
Copy link
Member

vcunat commented May 6, 2023

This merge brought back some channel-blocking errors https://hydra.nixos.org/eval/1794619 (related to PR #229826)

I hope that some of you understand why, or at least better than me.

@vcunat
Copy link
Member

vcunat commented May 6, 2023

@RaitoBezarius: so, reverting for now? #230386

@RaitoBezarius
Copy link
Member Author

I can take a look to them tomorrow, but I am okay with revert if you prefer to unblock the channel now.

@vcunat
Copy link
Member

vcunat commented May 6, 2023

OK, reverted for now. I'm trying to keep the lag of the channels short continuously, say under 48h for -small ones.

@RaitoBezarius
Copy link
Member Author

Result of nixpkgs-review pr 228047 run on x86_64-linux 1

2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
2 packages built:
  • tests.testers.nixosTest-example
  • tests.trivial-builders.references

@RaitoBezarius
Copy link
Member Author

For reference, the problem is here:

machine: must succeed: mount
machine # [    5.571187] dbus-daemon[899]: dbus[899]: Unknown username "systemd-timesync" in message bus configuration file
(finished: must succeed: mount, in 0.02 seconds)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=75688k,nr_inodes=186849,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=3,mode=620,ptmxmode=666)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,size=756880k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=378440k,mode=755)
ramfs on /run/keys type ramfs (rw,nosuid,nodev,relatime,mode=750)
tmpfs on /run/wrappers type tmpfs (rw,nodev,relatime,size=756880k,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
/dev/vdb on / type ext4 (rw,relatime)
nix-store on /nix/.ro-store type 9p (rw,relatime,dirsync,loose,access=client,msize=16384,trans=virtio)
tmpfs on /nix/.rw-store type tmpfs (rw,relatime,mode=755)
shared on /tmp/shared type 9p (rw,relatime,sync,dirsync,access=client,msize=16384,trans=virtio)
xchg on /tmp/xchg type 9p (rw,relatime,sync,dirsync,access=client,msize=16384,trans=virtio)
overlay on /nix/store type overlay (rw,relatime,lowerdir=/mnt-root/nix/.ro-store,upperdir=/mnt-root/nix/.rw-store/store,workdir=/mnt-root/nix/.rw-store/work)
overlay on /nix/store type overlay (ro,relatime,lowerdir=/mnt-root/nix/.ro-store,upperdir=/mnt-root/nix/.rw-store/store,workdir=/mnt-root/nix/.rw-store/work)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-tmpfiles-setup-dev.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-sysctl.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs on /run/credentials/systemd-tmpfiles-setup.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)

@RaitoBezarius
Copy link
Member Author

(double nix store mounts)

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

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants