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

No networking with libvirt > 10.3.0 and Vagrant driver + libvirt provider #285

Open
githubixx opened this issue Nov 28, 2024 · 1 comment

Comments

@githubixx
Copy link

I'm not sure if I'm in the right place here 😉 But it looks like that it might be an issue with Molecule vagrant plugin. I'm on Archlinux. Currently the following components are installed:

Kernel: 6.12.1
Vagrant: 2.4.2
python-vagrant: 1.1.0
libvirt: 10.3.0 (latest available version 10.9.0)

vagrant plugin list
vagrant-libvirt (0.12.3.pre.18, global)

I'm maintaining various Ansible roles like

https://github.com/githubixx/ansible-role-wireguard/blob/master/molecule/default/molecule.yml
https://github.com/githubixx/ansible-role-containerd/blob/master/molecule/default/molecule.yml

To test my roles I'm using Molecule and the vagrant driver with libvirt provider. E.g.:

dependency:
  name: galaxy
  options:
    role-file: requirements.yml

driver:
  name: vagrant
  provider:
    name: libvirt
    type: libvirt

platforms:
  - name: test-cd-ubuntu2004-base
    box: generic/ubuntu2004
    memory: 2048
    cpus: 2
    groups:
      - ubuntu
    interfaces:
      - auto_config: true
        network_name: private_network
        type: static
        ip: 172.16.10.10
  - name: test-cd-ubuntu2204-base
    box: alvistack/ubuntu-22.04
    memory: 2048
    cpus: 2
    groups:
      - ubuntu
    interfaces:
      - auto_config: true
        network_name: private_network
        type: static
        ip: 172.16.10.20

This worked fine all the times. But since libvirt 10.4.0 and newer I can't get the network of the virtual machines running anymore. I was hoping that the problem will be fixed with newer libvirt versions but sadly with libvirt 10.9.0 the issue is still there.

With libvirt 10.3.0 molecule converge runs just fine. But with libvirt >= 10.4.0 - no luck. All the other components are the same and it also doesn't depend on the Linux OS used for the VMs. So if I run molecule converge it looks like this:

WARNING  Driver vagrant does not provide a schema.
INFO     default scenario test matrix: dependency, create, prepare, converge
INFO     Performing prerun with role_name_check=0...
INFO     Running default > dependency
WARNING  Skipping, missing the requirements file.
WARNING  Skipping, missing the requirements file.
INFO     Running default > create

PLAY [Create] ******************************************************************

TASK [Create molecule instance(s)] *********************************************

The VMs start like usual and I can see them in the virt-manager UI:

libvirt

But then nothing happens anymore for quite a while. If I then open a VM via virt-manager to see the console output it looks like this (Ubuntu 24.04.1 in this case):

ubuntu24_startup

So the whole startup is obviously waiting for the network. After some time the startup continues but if you login via virt-manager and run ip addr there is no networking configured (well at least no IP addresses):

ubuntu24_ip_addr

Sooner or later I get fatal: [localhost]: FAILED! => {"changed": false, "cmd": ["/usr/bin/vagrant", "up", "--no-provision"], "msg": "Failed to start the VM(s): See log file '/home/ausername/.cache/molecule/githubixx.containerd/default/vagrant.err. The vagrant.err looks like this:

vagrant.err.txt

and the created VMs are shutting down.

So maybe someone has an idea. That would be nice 😃 Downgrading to libvirt 10.3.0 works as mentioned but I guess sooner or later that will also stop to work because of whatever dependencies and I'd really like to keep my setup. Thx!

@githubixx
Copy link
Author

One addition: The vagrant.err above contains messages like [fog][WARNING] Unrecognized arguments: libvirt_ip_command. But they also occur with libvirt 10.3.0 (the last version that is working as expected):

### 2024-11-28 20:58:07 ###
### 2024-11-28 20:58:07 ###
### 2024-11-28 20:58:07 ###
### 2024-11-28 20:58:07 ###
### 2024-11-28 20:58:07 ###
[fog][WARNING] Unrecognized arguments: libvirt_ip_command
[fog][WARNING] Unrecognized arguments: libvirt_ip_command
[fog][WARNING] Unrecognized arguments: libvirt_ip_command
[fog][WARNING] Unrecognized arguments: libvirt_ip_command
### 2024-11-28 20:58:07 ###
[fog][WARNING] Unrecognized arguments: libvirt_ip_command
### 2024-11-28 20:58:07 ###
[fog][WARNING] Unrecognized arguments: libvirt_ip_command
### 2024-11-28 20:58:07 ###
[fog][WARNING] Unrecognized arguments: libvirt_ip_command
### 2024-11-28 20:58:07 ###
[fog][WARNING] Unrecognized arguments: libvirt_ip_command

So the message most probably isn't that relevant.

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