Bug 1697773 - vagrant-libvirt-0.0.45-1 causes vm.network "private_network" to no longer work
Summary: vagrant-libvirt-0.0.45-1 causes vm.network "private_network" to no longer work
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: vagrant-libvirt
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Vít Ondruch
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-09 05:35 UTC by Joe Doss
Modified: 2019-04-11 15:01 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-04-11 15:01:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Vagrantfile example (931 bytes, text/plain)
2019-04-09 05:35 UTC, Joe Doss
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github 958 0 None None None 2020-09-21 13:11:07 UTC

Description Joe Doss 2019-04-09 05:35:55 UTC
Created attachment 1553780 [details]
Vagrantfile example

Description of problem:

Upstream issue https://github.com/vagrant-libvirt/vagrant-libvirt/issues/958#issuecomment-481106254

When you include devel.vm.network "private_network", :ip => '10.221.100.100' in your Vagrantfile it errors out with:

Network 10.221.100.100 is not available. Specify available network
name, or an ip address if you want to create a new network.

This blocks you from using Ansible with a static IP in inventory. 


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

$ rpm -qa |grep vagrant
vagrant-2.2.3-1.fc30.noarch
vagrant-libvirt-0.0.45-1.fc30.noarch


How reproducible:

Always


Steps to Reproduce:
1. Load attached Vagrantfile on Fedora 30 Beta with vagrant-2.2.3-1.fc30.noarch and vagrant-libvirt-0.0.45-1.fc30.noarch
2. See the below error.
3. Downgrade to vagrant-libvirt-0.0.40-5.fc29.noarch to fix your issue.

Actual results:

Network 10.221.100.100 is not available. Specify available network
name, or an ip address if you want to create a new network.

Expected results:

eth1 configured with 10.221.100.100


Additional info:

Downgrading to vagrant-libvirt-0.0.40-5.fc29.noarch fixes the issue and let's you use devel.vm.network "private_network", :ip => '10.221.100.100' in your Vagrantfile again:

sudo dnf install https://kojipkgs.fedoraproject.org//packages/rubygem-fog-core/1.43.0/5.fc29/noarch/rubygem-fog-core-1.43.0-5.fc29.noarch.rpm
sudo dnf install https://kojipkgs.fedoraproject.org//packages/vagrant-libvirt/0.0.40/5.fc29/noarch/vagrant-libvirt-0.0.40-5.fc29.noarch.rpm

Comment 1 Pavel Valena 2019-04-09 10:31:09 UTC
I'm afraid this is side-effect of enablement QEMU Session by default [0].

Could you try putting ` libvirt.qemu_use_session = false ` in your Vagrantfile?


[0] https://fedoraproject.org/wiki/Changes/Vagrant_2.2_with_QEMU_Session#Upgrade.2Fcompatibility_impact

Comment 2 Joe Doss 2019-04-09 13:09:39 UTC
Yep setting ` libvirt.qemu_use_session = false ` in the Vagrantfile fixes this issue.

    devel.vm.provider "libvirt" do |vm|
      vm.cpus = 2
      vm.driver = "kvm"
      vm.memory = 4096
      vm.nic_model_type = "e1000"
      vm.qemu_use_session = false
    end

This is a pretty breaking change to push out on a non major release without much documentation or clarification. Maybe we can put something in the error message in your upstream PR (https://github.com/vagrant-libvirt/vagrant-libvirt/pull/969) about the network not being available and that this new setting is needed if you want to use a private_network. Then at least it will help end users see that they need to add something to their Vagrantfiles. The private_network setting is heavily used with Ansible when developing playbooks and roles on Vagrant.

I can totally see using QEMU Sessions being enabled by default a major positive thing for new Vagrant users on Fedora so they don't need to muck around with user groups or ACLs.

Comment 3 Jason Montleon 2019-04-09 14:50:26 UTC
It would be nice, if with this change, that this option was globally configurable on or off.

To get the old behavior I now have to modify every Vagrantfile as it doesn't play correctly with VM's that were created prior to upgrade.

It also fails to work unless I manually create ~/VirtualMachines

Comment 4 Vít Ondruch 2019-04-10 08:10:47 UTC
(In reply to Joe Doss from comment #2)
> This is a pretty breaking change to push out on a non major release

We are pushing it in major release, in major release of Fedora, i.e. in F30. This was ours, i.e. maintainers of Vagrant in fedora, decision to change the default, not upstream. And frankly, there is no good time to do this switch, now is as good as tomorrow, because it will definitely break someones setup.

> without much documentation or clarification.

This is properly documented and communicated as far as Fedora standards requires:

https://fedoraproject.org/wiki/Changes/Vagrant_2.2_with_QEMU_Session

This should propagate to Fedora Release notes. If you have some suggestions for improvement of the change proposal, feel free to update the wiki (I assume you are able to edit the page).

Comment 5 Vít Ondruch 2019-04-10 08:15:53 UTC
(In reply to Jason Montleon from comment #3)
> It would be nice, if with this change, that this option was globally
> configurable on or off.

Well, the problem is that as far as I know, Vagrant doesn't have some global/system configuration file (unless you want to put Vagrantfile into your root directory) :/ But I guess you should be able to change the defaults for your user via ~/.vagrant.d/Vagrantfile

Comment 6 Joe Doss 2019-04-10 14:39:11 UTC
(In reply to Vít Ondruch from comment #4)
> We are pushing it in major release, in major release of Fedora, i.e. in F30.
> This was ours, i.e. maintainers of Vagrant in fedora, decision to change the
> default, not upstream. And frankly, there is no good time to do this switch,
> now is as good as tomorrow, because it will definitely break someones setup.

I should have been more clear. I meant to echo the same sentiment from upstream (https://github.com/vagrant-libvirt/vagrant-libvirt/pull/969#issuecomment-463193072) that changing this default is going to have deep impacts on the current user base. Sorry for not being more clear here. I do agree with you on your points that there is no good time to change this default. I do see the benefits of changing it for new users so I get why you and Pavel made the choice to do it in Fedora 30. 

> This is properly documented and communicated as far as Fedora standards
> requires:
> 
> https://fedoraproject.org/wiki/Changes/Vagrant_2.2_with_QEMU_Session
> 
> This should propagate to Fedora Release notes. If you have some suggestions
> for improvement of the change proposal, feel free to update the wiki (I
> assume you are able to edit the page).

Fair enough. I guess to push things forward to try and prevent other users from being impacted I pushed a PR to upstream that:

* Adds in a new environment variable VAGRANT_LIBVIRT_QEMU_USE_SESSION so you can globally turn off/on QEMU sessions and documents the change.
* Clears up the error "Network X is not available. Specify available network name, or an ip address if you want to create a new network" so it is more clear on what the problem is. 

https://github.com/vagrant-libvirt/vagrant-libvirt/pull/997

Comment 7 Vít Ondruch 2019-04-11 05:29:32 UTC
(In reply to Joe Doss from comment #6)
> I guess to push things forward to try and prevent other users
> from being impacted I pushed a PR to upstream that:

Thx a lot!

> * Adds in a new environment variable VAGRANT_LIBVIRT_QEMU_USE_SESSION so you
> can globally turn off/on QEMU sessions and documents the change.

Nice, we might consider removing the patch and using the env variable instead.

> * Clears up the error "Network X is not available. Specify available network
> name, or an ip address if you want to create a new network" so it is more
> clear on what the problem is. 

Very useful. Thx.


Do you think we can close this ticket now and probably open new one to consider the env variable and enhancing the error message once accepted (released) upstream?

Comment 8 Joe Doss 2019-04-11 15:01:52 UTC
No problem Vit. Thanks to you and Pavel for your work on Vagrant in Fedora. Let's see what upstream wants to do and I will open a new BZ if they accept my patches so we can include them in Fedora.


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