NixOS / nixops

NixOps is a tool for deploying to NixOS machines in a network or cloud.
https://nixos.org/nixops
GNU Lesser General Public License v3.0
1.84k stars 363 forks source link

libvirtd domain not updated for some settings #848

Open teto opened 6 years ago

teto commented 6 years ago

I've introduced new libvirt settings cmdline/kernel recently and I am not sure to understand how nixops deploy -d should work. I would like to dynamically adjust the boot settings in my deployment.nix (adding cmdline to the libvirt domain), rerun deploy afterwards and see the domain updated accordingly. Right now this seems completely ignored.

let
  libvirtd-base = {
      headless = true;
      extraDevicesXML = ''
        <serial type='pty'>
        <target port='0'/>
        </serial>
        <console type='pty'>
        <target type='serial' port='0'/>
        </console>
      '';
      # potentially might set networks to 0
      extraDomainXML = ''
        <on_crash>preserve</on_crash>
      '';
  };

in
  libvirtd-local = { config, pkgs, ... }: {
    deployment.targetEnv = "libvirtd";
    # If i concatenate/deconcatenate the set to libvirtd-base should the domain be updated ?
    deployment.libvirtd = libvirtd-base // {
      cmdline="root=/dev/sda1 earlycon=ttyS0 console=ttyS0 init=/nix/var/nix/profiles/system/init boot.debug=1 boot.consoleLogLevel=1 ";
      kernel="/home/teto/my_kernel/build/arch/x86_64/boot/bzImage";
    };
  };
teto commented 6 years ago

I am willing to put up a PR if some explains to me how I can have a change in the "kernel" file trigger a reboot on nixops deploy ? like if the creation time changed, I would like my VMs to reboot on the next deploy --reboot