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

Define the bridge name in advance for a routed network #1087

Open
bashfulrobot opened this issue Jun 24, 2024 · 3 comments
Open

Define the bridge name in advance for a routed network #1087

bashfulrobot opened this issue Jun 24, 2024 · 3 comments

Comments

@bashfulrobot
Copy link

This is not so much a bug, but rather a simple question.

Is there a way to specify the bridge name when creating the libvirt route network mode? It seems to ignore the bridge option (your docs even say that it is only needed for a bridged mode).

It seems like it just chooses the next available virbir"x" that is available.

For some of my automation, I need to know what the bridge will be created as. I just wanted to check before I went down the route of trying to automate "getting" the next one in line.

Thank you.

@scabala
Copy link
Contributor

scabala commented Sep 2, 2024

For such questions, I think it would be helpful to try to replciate behavior with pure libvirt using virsh -if you can specify bridge name before creating network than I believe it should be possible to do so with terraform-provider-libvirt when implemented. If not, that's limitation of libvirt that cannot be overcome here.

Out of curiosity, what's the automation you mentioned?

@bashfulrobot
Copy link
Author

bashfulrobot commented Sep 7, 2024

By Automation, I simply meant my TF modules that deploy a k8s cluster.

As for creating a network with virsh I have traditionally done it with something like:

  • create a file called kvm-my-bridge.xml with:
<network>
  <name>kvm-my-bridge</name>
  <forward mode="bridge"/>
  <bridge name="br0"/>
</network>
  • Then Create and enable this network by running:
virsh net-define /path/to/my/kvm-my-bridge.xml
virsh net-start kvm-my-bridge
virsh net-autostart kvm-my-bridge

@scabala
Copy link
Contributor

scabala commented Sep 10, 2024

Thank you for the example.
I guess it's just limitation of the provider and could be improved.

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

2 participants