dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.59k stars 458 forks source link

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

Closed dmacvicar closed 4 years ago

dmacvicar commented 4 years ago

This PR means to supersede/replace https://github.com/dmacvicar/terraform-provider-libvirt/pull/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 https://github.com/dmacvicar/terraform-provider-libvirt/issues/703

MalloZup commented 4 years ago

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