Bug 1582459 - Vagrant network config for systemd-networkd in Debian guest plugin has too low priority
Summary: Vagrant network config for systemd-networkd in Debian guest plugin has too lo...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: vagrant
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Pavel Valena
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-25 09:46 UTC by Jaroslaw Gorny
Modified: 2018-12-12 01:44 UTC (History)
8 users (show)

Fixed In Version: vagrant-2.0.2-5.fc28
Clone Of:
Environment:
Last Closed: 2018-12-12 01:44:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
simple Vagrantfile to reproduce the issue (333 bytes, text/plain)
2018-05-25 09:46 UTC, Jaroslaw Gorny
no flags Details

Description Jaroslaw Gorny 2018-05-25 09:46:29 UTC
Created attachment 1441477 [details]
simple Vagrantfile to reproduce the issue

Description of problem:

When using Debian guest with systemd-networkd (default), the network configuration is being created as /etc/systemd/network/99-vagrant.network
But the default config, in /etc/systemd/network/99-default.network sets all the network interfaces matching the pattern "e*" to use DHCP. As the result, it is not possible to use static IP on any interface.

Version-Release number of selected component (if applicable):
vagrant-2.0.2-1

How reproducible:
Always

Steps to Reproduce:
1. Install vagrant (disclaimer: I'm using 'libvirt' provider, but this really should behave the same for others, including the default VirtualBox provider)

2. Create the Vagrantfile as in attachment
3. Run the command: "vagrant up"

Actual results:
When you login to the vm, using "vagrant ssh test_vm", and check the IP configuration, you'll notice the interface got the address in "172.16.0/24" network via DHCP. The address is different than "172.16.0.2" which is specified in the Vagrantfile.

If you check /etc/systemd/network, you'll see what I described at the beginning of this bug -- the 99-default.network enforces all interfaces matching "e*" to use DHCP, which overwrites the manual setting, which is in 99-vagrant.network.

Expected results:
The machine should use the address specified in the Vagrantfile ("172.16.0.2" in my example).


Additional info:
This problem has been reported upstream as:
https://github.com/hashicorp/vagrant/issues/9592

It is now set to CLOSED, it was supposed to be fixed in 2.0.4 by the following PR:
https://github.com/hashicorp/vagrant/pull/9646/files

This patch is incorrect, because it changes the priority of the "netplan" file, not the systemd-networkd configuration.

I've already commented on that issue, asking for it to be re-opened. And I've created a proper patch for this:
https://github.com/hashicorp/vagrant/pull/9867

If we don't want to patch Vagrant in Fedora, I can monitor, and comment here once my patch is merged upstream.

Comment 1 Anatoli Babenia 2018-07-20 02:09:58 UTC
https://github.com/hashicorp/vagrant/pull/9867 is merged.

Comment 2 Pavel Valena 2018-10-17 16:13:15 UTC
Anatoli,
thanks for the patch! I'll backport it.

In the meantime you can check my COPR with latest rawhide Vagrant[0](which has the issue solved).

Regards,
Pavel

[0] https://copr.fedorainfracloud.org/coprs/pvalena/vagrant/

Comment 3 Fedora Update System 2018-12-03 19:31:22 UTC
vagrant-2.0.2-5.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-66659d070f

Comment 4 Fedora Update System 2018-12-04 03:38:30 UTC
vagrant-2.0.2-5.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-66659d070f

Comment 5 Anatoli Babenia 2018-12-04 16:58:21 UTC
Just to be clear - the patch is not mine, I just gave the pointer. ;)

Comment 6 Pavel Valena 2018-12-05 09:15:49 UTC
Anatoli,

thanks and no worries. The PR you linked was merged and the changes stayed in `master` branch, so it's upstream code now. (Also, the fix was obvious.)

Regards,
Pavel

Comment 7 Fedora Update System 2018-12-12 01:44:57 UTC
vagrant-2.0.2-5.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.