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

Synchonize network defines to workaround libvirt bridge name race condition #789

Merged
merged 5 commits into from
Sep 30, 2020

Conversation

dmacvicar
Copy link
Owner

This PR means to supersede/replace #740

libvirt assigns the same bridge to networks defined in parallel (See https://gitlab.com/libvirt/libvirt/-/issues/78).

This code synchronizes network definition.

Note that there is still a problem in the code that generates wrong DHCP ranges. I could only prove it comes from our generated XML, but I could not figure how the race happens. We will need to address that as a separate issue.
I believe we need to remove most of the network code, and be a thin layer on top of libvirt. It may require us to align our definitions, eg. no dhcp option in the network block, and a explicit range option.

Fixes #703

This reverts commit 3a67604, reversing
changes made to 8d6f2c4.

If the problem comes from a race, it shoul be sinchronized. If libvirt allows
not passing a bridge, we should not force one.
This allows a race on the DHCP range generation. It does not look to be
related to libvirt so it needs to be addressed separately.
Eventually removing all this clever code fromt the resource.
Copy link
Collaborator

@MalloZup MalloZup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work. I always like when people put comments reference/links in code which helps to remember why it exists there 👍

e.g I think we missed an opportunity to document why the Pool locks are there. i

@MalloZup
Copy link
Collaborator

I thnk for the DHCP issue we can have a follow-up issue.

@dmacvicar dmacvicar merged commit fb8e641 into master Sep 30, 2020
@MalloZup MalloZup deleted the issue_703 branch November 11, 2020 09:50
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

Successfully merging this pull request may close these issues.

Create 2 KVM libvirt networks failed
2 participants