Open joseph-long opened 6 years ago
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 ]; }"
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.
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:
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 haveqemu-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 installingqemu
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 startqemu-ga
.Technical details
"x86_64-linux"
Linux 4.9.77, NixOS, 17.09.2816.ae24fad5abf (Hummingbird)
no
yes
nix-env (Nix) 1.11.16
"nixos-17.09.2816.ae24fad5abf"
/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs