nixos/virtualisation: add option for explicitly named network interfaces#178290
nixos/virtualisation: add option for explicitly named network interfaces#178290RaitoBezarius merged 1 commit intoNixOS:masterfrom
Conversation
881ebac to
337f2d9
Compare
337f2d9 to
be93afb
Compare
nixos/lib/build-vms.nix
Outdated
There was a problem hiding this comment.
I chose to use udev rules rather than systemd.network.links because in the latter case, systemd ignores all but one file that applies to a given interface. I did not want to preclude users from using that module elsewhere.
ce0059f to
db98006
Compare
db98006 to
8580287
Compare
|
cc @roberth since I see you as the last committer to build-vms.nix |
|
Oh, I'm actually replacing The changes in I'm arranging to run aforementioned PR on Hydra. I think this PR can be the next one to run there. |
Got it. Should I wait until that gets merged and rebase? Or should I just cut a branch off of yours? |
8580287 to
7e1a7f3
Compare
|
tl;dr: This PR is not blocked and can be reviewed by any maintainer who is familiar with NixOS networking.
Ok, while the big refactor is in a good shape, we won't be able to get it properly reviewed and merged in the coming 3 weeks. That all said, this PR isn't anything that can't be ported to my branch, and if another maintainer can review and merge this in the meanwhile, that is fine by me. I don't see any issues with how the code is structured. |
|
Perhaps @fpletz could review the changes, as it touches the We can also run all tests on hydra after the current https://hydra.nixos.org/jobset/nixos/python-test-refactoring completes. |
|
I just opened up a new PR against your branch here. If you have a chance to review and merge it, I'd really appreciate it! |
|
Hi, the module changes have been merged, so you can rebase the PR. I was looking for a qemu networking expert just now. What do you think of #200225? |
|
I am interested into helping getting this merged, can you fix the conflicts @andrew-hoff and move the release notes to 23.05 ? |
311ffb4 to
f162d9d
Compare
|
@RaitoBezarius I updated the PR and moved release notes to 23.05. Sorry for the slow response! |
|
@andrew-hoff Thank you for maintaining this conflict-less, it seems you introduced a merge commit recently, can you get rid of it? |
Adds a new option to the virtualisation modules that enables specifying explicitly named network interfaces in QEMU VMs. The existing `virtualisation.vlans` is still supported for cases where the name of the network interface is irrelevant.
e945a38 to
6ae3e76
Compare
Ah, sorry about that. Just cleaned it up. |
|
Thank you @RaitoBezarius ! |
Thank YOU for your incredible patience. :) |
|
#213118 |
Apologies for that breakage, I will run more tests to check. |
| } else { | ||
| name = "RenameInterface"; | ||
| testScript = ""; |
There was a problem hiding this comment.
this is unfinished
> nixosTests.networking.scripted.rename
error: The option `nodes' is used but not defined.
|
Well, while evaluation got fixed, some of the tests fail or time out. (And they work if I revert this PR and the fixups.) And so the |
I'm fine with reverting this PR as it requires clearly more work at the moment I guess. |
|
Opened as #213519 |
|
Found an interesting issue, maybe people here will be interested. |
Adds a new option to the virtualisation modules that enables specifying explicitly named network interfaces in QEMU VMs. The existing
virtualisation.vlansis still supported for cases where the name of the network interface is irrelevant.This feature is useful for creating VMs with network configurations that exactly match the network configuration of real-world devices for more accurate SITL testing.
Description of changes
virtualisation.interfacesoption toqemu-vm.nix.virtualisation.vlansto empty ifvirtualisation.interfacesis not empty. This avoids a scenario where a user specifiesvirtualisation.interfaces, but inadvertently still has a network interface from the defaultvirtualisation.vlans.build-vms.nixto create the new network interfaces using QEMU options.build-vms.nixto rename network interfaces using udev rules.testing-python.nixto use the union of the VLANs specified invirtualisation.vlansandvirtualisation.interfaceswhen collecting the list of VLANs.nixos/tests/networking.nixto use the new option where applicable. This cut down on unnecessary overrides to remove IP addresses from network interfaces.Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes