vagrant-libvirt: handle_dhcp_private_network doesn't pick up found network name correctly

The provider does not appear to create the vagrant-private-dhcp network for instances with a private_network interface.

Steps to reproduce

  1. vagrant up with a private network specified in the Vagrantfile

Expected behaviour

The instance should come up with a private network interface.

Actual behaviour

Vagrant errors out with: Call to virDomainCreateWithFlags failed: Network not found: no network with matching name 'vagrant-private-dhcp'

virsh agrees with its assessment:

% sudo virsh net-list
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              active     yes           yes
 infra-ng0            active     no            yes
 vagrant-libvirt      active     no            yes

System configuration

OS/Distro version::

Fedora 23

Libvirt version:

libvirt-1.2.18.3-1.fc23.x86_64

Output of vagrant version; vagrant plugin list:

Installed Version: 1.8.1
Latest Version: 1.8.4

To upgrade to the latest version, visit the downloads page and
download and install the latest version of Vagrant from the URL
below:

  http://www.vagrantup.com/downloads.html

If you're curious what changed in the latest release, view the
CHANGELOG below:

  https://github.com/mitchellh/vagrant/blob/v1.8.4/CHANGELOG.md
landrush (1.0.0)
vagrant-libvirt (0.0.33, system)

Output of VAGRANT_LOG=debug vagrant up --provider=libvirt

vagrant-up-log.txt

A Vagrantfile to reproduce the issue:

Vagrant.configure(2) do |config|
  config.vm.box = 'fedora/24-cloud-base'
  config.vm.network "private_network", type: "dhcp"
end

Are you using upstream vagrant package or your distros package?

Distro

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

If you are using Fedora the problem can be caused when you upgrade by this: https://fedoraproject.org/wiki/Changes/Vagrant_2.2_with_QEMU_Session

So adding libvirt.qemu_use_session = false to your Vagrantfile may fix it.