Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: nixos/xen: init guest-agent module #341129

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

SigmaSquadron
Copy link
Contributor

@SigmaSquadron SigmaSquadron commented Sep 11, 2024

Description of changes

Turns the profile meant for Xen guests into a proper module that can be enabled as an option.
We also enable it by default on the graphical ISO and differentiate the wording of the xe-guest-agent module, which is the Citrix XenServer guest utilities.

This is based on @matdibu's previous work.

A lot of testing is required before this can be merged. Any and all testers are welcome to help us out!

Things done

  • Built on platform(s)
    • x86_64-linux
  • Tested, as applicable: Invalid
    • We desperately need an automated testing suite. Manual testing has revealed no issues when providing a separately-built kernel and starting the NixOS activation script from the hypervisor.
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review pr 341129". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of ISO images, HVM domains and PV/PVH domains
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

We now have a module that enables the upstream Xen Guest Agent, so
we shouldn't tell users Citrix's XenServer tools are the main Xen
guest utilities.

Signed-off-by: Fernando Rodrigues <[email protected]>
@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 Sep 11, 2024
@SigmaSquadron SigmaSquadron added 2.status: work-in-progress This PR isn't done 11.by: package-maintainer This PR was created by the maintainer of the package it changes and removed 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 Sep 11, 2024
@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 Sep 11, 2024
@SigmaSquadron
Copy link
Contributor Author

@matdibu: Hey mate, this is a rough draft so far, but I'd appreciate any comments you may have, as you're more experienced than me with the new rust-based tools.

nixos/modules/virtualisation/xen-domU.nix Outdated Show resolved Hide resolved
nixos/modules/virtualisation/xen-domU.nix Outdated Show resolved Hide resolved
@matdibu
Copy link
Contributor

matdibu commented Sep 11, 2024

@matdibu: Hey mate, this is a rough draft so far, but I'd appreciate any comments you may have, as you're more experienced than me with the new rust-based tools.

you're giving me too much credit, I was just playing around with XCP-ng so I decided to make the experience a bit better for NixOS

that being said, this is nice, thank you!

@ofborg ofborg bot requested a review from matdibu September 11, 2024 15:10
@SigmaSquadron SigmaSquadron changed the title WIP: nixos/xen: init guest-agent module (DO NOT MERGE) WIP: nixos/xen: init guest-agent module Sep 13, 2024
@SigmaSquadron
Copy link
Contributor Author

SigmaSquadron commented Sep 13, 2024

Sooo, this seems to cause a disko rebuild. I have no idea why. because disko depends on the default ISO files.

@wexder
Copy link
Contributor

wexder commented Sep 13, 2024

@SigmaSquadron Trying to run this by copying it into my configurations, I run into issue:

error: builder for '/nix/store/6yh0amr86fxacw7arv7a3i3495pxsdgm-linux-6.6.51-modules-shrunk.drv' failed with exit code 1;
       last 10 log lines:
       > root module: xen_netfront
       >   copying dependency: /nix/store/jhd4b6hjjbsfig5vdanp0z6a82ba8hjd-linux-6.6.51-modules/lib/modules/6.6.51/kernel/drivers/net/xen-netfront.ko.xz
       > root module: xen_pcifront
       >   copying dependency: /nix/store/jhd4b6hjjbsfig5vdanp0z6a82ba8hjd-linux-6.6.51-modules/lib/modules/6.6.51/kernel/drivers/pci/xen-pcifront.ko.xz
       > root module: xen_scsifront
       >   dependency already copied: /nix/store/jhd4b6hjjbsfig5vdanp0z6a82ba8hjd-linux-6.6.51-modules/lib/modules/6.6.51/kernel/drivers/scsi/scsi_common.ko.xz
       >   dependency already copied: /nix/store/jhd4b6hjjbsfig5vdanp0z6a82ba8hjd-linux-6.6.51-modules/lib/modules/6.6.51/kernel/drivers/scsi/scsi_mod.ko.xz
       >   copying dependency: /nix/store/jhd4b6hjjbsfig5vdanp0z6a82ba8hjd-linux-6.6.51-modules/lib/modules/6.6.51/kernel/drivers/scsi/xen-scsifront.ko.xz
       > root module: xen_balloon
       > modprobe: FATAL: Module xen_balloon not found in directory /nix/store/jhd4b6hjjbsfig5vdanp0z6a82ba8hjd-linux-6.6.51-modules/lib/modules/6.6.51
       For full logs, run 'nix log /nix/store/6yh0amr86fxacw7arv7a3i3495pxsdgm-linux-6.6.51-modules-shrunk.drv'.
error: 1 dependencies of derivation '/nix/store/c4y9s9n2f5isbwsdfrnrbw5v6ywnaswq-initrd-linux-6.6.51.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gjpv0lmis474abx92mi34j3ixjplbm3w-nixos-system-nixos-24.11.20240913.537289e.drv' failed to build
error: 1 dependencies of derivation '/nix/store/rzlk3f3dbxwgll6y3sq7si8y8w15pyyx-activatable-nixos-system-nixos-24.11.20240913.537289e.drv' failed to build
error: 1 dependencies of derivation '/nix/store/q8bfq6a1j3pglybjpy7xhdsgcw1r5qvk-deploy-rs-check-activate.drv' failed to build
error: build of '/nix/store/0f5301z5mm0p0p015im4mg3hw1i5fch9-jsonschema-deploy-system.drv', '/nix/store/q8bfq6a1j3pglybjpy7xhdsgcw1r5qvk-deploy-rs-check-activate.drv' failed

Other then that it seems to be working great

@SigmaSquadron
Copy link
Contributor Author

yep, that and the fact that the ISO image is using the old option is why I just added DO NOT MERGE

will fix it tomorrow

…efault

Does nothing if the ISO is not a domU, but it should write XenStore
entries if we're running in a Xen VM.

Signed-off-by: Fernando Rodrigues <[email protected]>
mainProgram is required for the module, but we also take the opportunity
to remove the `rec` statement.

Signed-off-by: Fernando Rodrigues <[email protected]>
Turns xen-domU.nix into an extension of the virtualisation.xen options,
allowing users to enable the xen-guest-agent service (all VM types), and
enable recommended settings for minimal PV/PVH domains.

Signed-off-by: Fernando Rodrigues <[email protected]>
@SigmaSquadron SigmaSquadron changed the title (DO NOT MERGE) WIP: nixos/xen: init guest-agent module nixos/xen: init guest-agent module Sep 15, 2024
@SigmaSquadron SigmaSquadron removed the 2.status: work-in-progress This PR isn't done label Sep 15, 2024
@SigmaSquadron SigmaSquadron marked this pull request as ready for review September 15, 2024 00:43
@SigmaSquadron

This comment was marked as outdated.

@SigmaSquadron
Copy link
Contributor Author

cc @ElvishJerricco as the latest ISO maintainer to be touched by the nixpkgs curse.

97cdedf

@SigmaSquadron SigmaSquadron added the 6.topic: xen-project The Xen Project hypervisor label Sep 25, 2024
@SigmaSquadron SigmaSquadron marked this pull request as draft September 27, 2024 17:55
@SigmaSquadron SigmaSquadron removed the request for review from matdibu September 27, 2024 17:56
@SigmaSquadron
Copy link
Contributor Author

SigmaSquadron commented Sep 27, 2024

To avoid merge conflicts, I'll wait for #344314 to be merged first and target this for 25.05.

@SigmaSquadron SigmaSquadron added the 2.status: work-in-progress This PR isn't done label Sep 29, 2024
@SigmaSquadron SigmaSquadron changed the title nixos/xen: init guest-agent module WIP: nixos/xen: init guest-agent module Sep 29, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 1, 2024
@SigmaSquadron
Copy link
Contributor Author

SigmaSquadron commented Dec 8, 2024

Depends on #363388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 2.status: work-in-progress This PR isn't done 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: xen-project The Xen Project hypervisor 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants