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

[BUG] Error when using forward hostdev virt.network state "Missing parameter bridge for state virt.network_running" #67755

Open
guillaumefenollar opened this issue Feb 20, 2025 · 2 comments
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@guillaumefenollar
Copy link

Description
When using states virt.network_defined or virt.network_running, with a forward: hostdev network type, Salt raises an error stating that bridge name is mandatory, although it does not make any sense.
full error is :

----------
           ID:  test
    Function: virt.network_running
      Result: False
     Comment: Missing parameter bridge for state virt.network_running
     Changes:

If I mention a bridge name in a sls (bridge: br0) , which does not make sense but anyway, the following error (libvirt generated I guess) appears instead :

----------
          ID: test
    Function: virt.network_running
        Name: test
      Result: False
     Comment: XML error: bridge name not allowed in hostdev mode (network 'test')
     Started: 13:37:49.955720
    Duration: 11.871 ms
     Changes:

Steps to Reproduce the behavior
Use this state to reproduce :

test: 
  virt.network_running: 
    - forward: hostdev
    - physical_function: enpXsXfX

Same behavior when using interfaces instead of physical_function.

Expected behavior
The state should be valid and virt network should be created and running

Workaround
I found the following Workaround. If I mention bridge: "", it passes the salt validation without the libvirt error.
Versions Report

Salt Version:
          Salt: 3006.9
 
Python Version:
        Python: 3.10.14 (main, Jun 26 2024, 11:44:37) [GCC 11.2.0]
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
  cryptography: 42.0.5
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.4
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.19.1
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.17.0
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: rhel 8.7 Ootpa
        locale: utf-8
       machine: x86_64
       release: 4.18.0-339.rt7.120.el8.x86_64
        system: Linux
       version: Red Hat Enterprise Linux 8.7 Ootpa
@guillaumefenollar guillaumefenollar added Bug broken, incorrect, or confusing behavior needs-triage labels Feb 20, 2025
Copy link

welcome bot commented Feb 20, 2025

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@guillaumefenollar
Copy link
Author

Additional Note : the workaround with bridge: "" is working but this log appears on each run, twice :

libvirt: Network Driver error : internal error: network 'test' does not have a bridge name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant