nix-community / nixops-libvirtd

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

Improve networking options for libvirtd target #2

Closed teto closed 1 year ago

teto commented 4 years ago

Follow up of https://github.com/NixOS/nixops/pull/922. The use of qemu-agent and some more configurability for libvirt scenarios

I suppose the ipaddress dependency could be dropped of but:

The only thing I don't understand is why the first deploy fails without: networking.networkmanager.enable = true; (nixops ssh seems to work fine, just the nix-copy-closure fails )

teto commented 4 years ago

so nix-copy-closure was stuck at

debug1: Sending command: nix-store --serve --write
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0

while opening wireshark, I saw the MTU was at 9000 for the libvirtd bridge. (I think TCP_NODELAY might be set, ) and found the related issue https://github.com/NixOS/nix/issues/1988 . I changed the bridge mtu to 1400 and it fixed it. I wonder if that's a kernel issue or something else.

teto commented 4 years ago

@nh2 @sorkin @mbrgm if you wanna test, it should be ready.

AmineChikhaoui commented 4 years ago

This seems to break existing deployments ?

[nix-shell:~/src/nixops]$ nixops deploy -d libvirt
[<nixopsvirtd.backends.libvirtd.LibvirtdNetwork instance at 0x7f22352a3a28>]
len=1
machine> Connecting to qemu:///system...
machine> connecting...
libvirt: QEMU Driver error : argument unsupported: QEMU guest agent is not configured
machine> argument unsupported: QEMU guest agent is not configured
libvirt: QEMU Driver error : argument unsupported: QEMU guest agent is not configured
machine> argument unsupported: QEMU guest agent is not configured
libvirt: QEMU Driver error : argument unsupported: QEMU guest agent is not configured
machine> argument unsupported: QEMU guest agent is not configured
ssh: Could not resolve hostname none: Name or service not known
libvirt: QEMU Driver error : argument unsupported: QEMU guest agent is not configured
machine> argument unsupported: QEMU guest agent is not configured
machine> could not connect to ‘root@None’, retrying in 1 seconds...
libvirt: QEMU Driver error : argument unsupported: QEMU guest agent is not configured
machine> argument unsupported: QEMU guest agent is not configured
ssh: Could not resolve hostname none: Name or service not known
libvirt: QEMU Driver error : argument unsupported: QEMU guest agent is not configured
machine> argument unsupported: QEMU guest agent is not configured
machine> could not connect to ‘root@None’, retrying in 2 seconds...
^Cerror: interrupted

Also there is debug statements left and many commented lines, can you make sure to remove those ?

teto commented 4 years ago

In order to be backwards compatible, I could check for both values of https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainInterfaceAddressesSource, e.g., to search for IPs seen by the libvirt router or by the agent. Would you prefer to make it configurable ? (with/without agent), not sure that's worth the effort IMO.