Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

public_network plugin doesn't find bridges on Ubuntu 22.04 #1788

Open
harenber opened this issue Nov 10, 2023 · 1 comment
Open

public_network plugin doesn't find bridges on Ubuntu 22.04 #1788

harenber opened this issue Nov 10, 2023 · 1 comment

Comments

@harenber
Copy link

Describe the bug
Vagrantfile containing

    j2.vm.network "public_network",
                    :dev => "virbr0",
                    :mode => "bridge",
                    :type => "bridge",
                    :ip => "10.1.1.1",
                    :netmask => "255.255.0.0"

gives the following error message on Ubuntu 22.04:

Libvirt Provider:
* network configuration 1 for machine jem2 is a public_network referencing host device 'virbr0' which does not exist, consider adding ':dev => ....' referencing one of eno3, eno1np0, eno4, eno2np1, enp94s0f0np0, enp94s0f1np1, eno1np0.910, eno1np0.108, eno1np0.104

The same configuration works fine on a Ubuntu 20.04 machine running the same version of the libvirt plugin.

virbr0 is existing:

root@jemserver:~/Vagrantfiles/jem1_2_alma9# ifconfig virbr0
virbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 132.195.XXX.XXX  netmask 255.255.254.0  broadcast 132.195.125.255
        inet6 fe80::84d4:13ff:fe4a:ac58  prefixlen 64  scopeid 0x20<link>
        inet6 XXXX  prefixlen 64  scopeid 0x0<global>
        ether 86:d4:13:4a:ac:58  txqueuelen 1000  (Ethernet)
        RX packets 439666  bytes 1360458757 (1.3 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 52060  bytes 6176749 (6.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
root@jemserver:~/Vagrantfiles/jem1_2_alma9# brctl show virbr0
bridge name	bridge id		STP enabled	interfaces
virbr0		8000.86d4134aac58	no		eno1np0
							vnet4
root@jemserver:~/Vagrantfiles/jem1_2_alma9# 

and also libvirt sees it:

root@jemserver:~/Vagrantfiles/jem1_2_alma9# virsh -c qemu:///system iface-list --all
 Name           State      MAC Address
----------------------------------------------
 docker0        inactive   02:42:b5:39:bd:32
 eno2np1        inactive   bc:97:e1:a6:bc:95
 eno3           inactive   bc:97:e1:a6:bc:92
 eno4           inactive   bc:97:e1:a6:bc:93
 enp94s0f0np0   inactive   bc:97:e1:cd:e4:90
 enp94s0f1np1   inactive   bc:97:e1:cd:e4:91
 lo             inactive   00:00:00:00:00:00
 virbr0         active     86:d4:13:4a:ac:58
 virbr0.104     active     66:c7:1f:ee:84:fb
 virbr0.108     active     9e:13:93:0b:0d:f2
 virbr0.910     active     36:ef:6a:e7:4b:a2

Maybe related to #1786 as we see this problem on Ubuntu 22.04 as well.

To Reproduce

Use the following Vagrantfile on an Ubuntu 22.04 host:

Vagrant.configure("2") do |config|

  #
  # JEM1
  #
  
  config.vm.define :jem1 do |j1|
    config.vm.provider :libvirt do |libvirt|
      libvirt.storage_pool_name = 'default'
      libvirt.cpus = 4
      libvirt.memory = 8192
      libvirt.management_network_mode = "none"
      libvirt.default_prefix = ""
      libvirt.machine_virtual_size = 200 # in GB
      libvirt.qemu_use_session = false
    end

    j1.vm.host_name = "jem1"
    j1.vm.box = "roboxes/alma9"
    j1.vm.box_check_update = false

    j1.vm.network "public_network",
                    :dev => "virbr0",
                    :mode => "bridge",
                    :type => "bridge",
                    :ip => "10.1.1.1",
                    :netmask => "255.255.0.0"

    j1.vm.provision "ansible" do |ansible|
      ansible.playbook = "ansible.yml"
    end

  end

Expected behavior

VM should be created. The same Vagrantfile is working on an Ubuntu 20.04 host pointing to a similar bridged device.

Screenshots

Versions (please complete the following information)::

  • Libvirt version: 0.12.2
  • Vagrant version [output of vagrant version]: 2.4.0
  • Vagrant flavour [Upstream or Distro]: Upstream
  • Vagrant plugins versions (including vagrant-libvirt) [output of vagrant plugin list]: vagrant-libvirt (0.12.2, global) is the only line

Debug Log
Attach Output of VAGRANT_LOG=debug vagrant ... --provider=libvirt >vagrant.log 2>&1

See here

A Vagrantfile to reproduce the issue:

See above

@harenber
Copy link
Author

harenber commented Mar 5, 2024

Just to mention that the problem is still there with a newer version of Vagrant:

root@jemserver:~# libvirtd -V
libvirtd (libvirt) 8.0.0
root@jemserver:~# vagrant version
Installed Version: 2.4.1
Latest Version: 2.4.1

You're running an up-to-date version of Vagrant!
root@jemserver:~# vagrant plugin list
vagrant-libvirt (0.12.2, global)
root@jemserver:~#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant