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

QEMU guest agent not available in OpenStack Nova image #34722

Open
joseph-long opened this issue Feb 8, 2018 · 3 comments
Open

QEMU guest agent not available in OpenStack Nova image #34722

joseph-long opened this issue Feb 8, 2018 · 3 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@joseph-long
Copy link
Contributor

joseph-long commented Feb 8, 2018

I built an OpenStack VM image using https://github.com/NixOS/nixpkgs/blob/master/nixos/maintainers/scripts/openstack/nova-image.nix (specifically nix-build '<nixpkgs/nixos>' -A config.system.build.novaImage --arg configuration "{ imports = [ <nixpkgs/nixos/maintainers/scripts/openstack/nova-image.nix> ]; }") and the resulting image does not have qemu-ga available.

The administrators of the OpenStack deployment I'm using tell me this is essential, so I am looking at how to make it available. It seems like the qemu-ga binary is made available by installing qemu itself, though e.g. Gentoo's qemu-guest-agent ebuild seems to build only the guest agent.

If the guest agent is indeed required for things like snapshotting Nova VMs, it seems like nova-image.nix should ensure qemu is installed and a systemd unit created to start qemu-ga.

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.9.77, NixOS, 17.09.2816.ae24fad5abf (Hummingbird)
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 1.11.16
  • channels(root): "nixos-17.09.2816.ae24fad5abf"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
@joseph-long
Copy link
Contributor Author

joseph-long commented Feb 8, 2018

Workaround

enable-qemu-guest-agent.nix

{config, pkgs, ...}:
{
  config = {
    # boot.kernelParams = [ "console=ttyS0" ];  ## Unclear if I can't see the console in the web UI because I'm missing this, or some other reason.
    environment.systemPackages = [ pkgs.qemu ];
    systemd.services.qemu-guest-agent = {
      description = "Run the QEMU Guest Agent";
      path = [ pkgs.qemu ];
      script = "qemu-ga";
      serviceConfig = {
        Restart = "always";
        RestartSec = 0;
      };
    };
    services.udev.extraRules = ''SUBSYSTEM=="virtio-ports", ATTR{name}=="org.qemu.guest_agent.0",  TAG+="systemd" ENV{SYSTEMD_WANTS}="qemu-guest-agent.service"'';
  };
}

then the command to build the image becomes

nix-build '<nixpkgs/nixos>' -A config.system.build.novaImage --arg configuration "{ imports = [ <nixpkgs/nixos/maintainers/scripts/openstack/nova-image.nix> ./enable-qemu-guest-agent.nix ]; }"

@teto
Copy link
Member

teto commented Feb 27, 2018

I would like to install qemu-agent in libvirtd images for nixops too. I believe it deserves its own name qemu-agent even if it's just an alias to qemu.

@stale
Copy link

stale bot commented Jun 5, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

2 participants