nix-community / nixops-libvirtd

NixOps libvirtd backend plugin [maintainer=@AmineChikhaoui]
GNU Lesser General Public License v3.0
35 stars 20 forks source link

Select IP of resulting machine #21

Open typetetris opened 3 years ago

typetetris commented 3 years ago

Can I somehow select the IP a machine will have later?

networking.privateIPv4 seems to have no effect.

sorki commented 3 years ago

This used to work by means of nixops filling networking.extraHosts so you could refer to other hosts in the network by their names.

Currently the output is just

networking = {
        extraHosts = "\n";
};

due to hosts in https://github.com/NixOS/nixops/blob/master/nixops/deployment.py#L655 not being populated, the function that should do this creates empty dict at https://github.com/NixOS/nixops/blob/master/nixops/deployment.py#L713

I don't get how this is supposed to work with the new plugin system - should nixops-libvirtd somehow provide IPs from its state?

Also I think that networking.privateIPv4 has no effect at all when looking at impl and it seems to be ignored even for guest IP queries (and for VM image creation).

This was quite useful feature of older nixops, which allowed to toy with clustered setups without any IPs or DNS servers.