dmacvicar / terraform-provider-libvirt

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

Fix/qemuagent #873

Closed maseman closed 2 years ago

maseman commented 2 years ago

Reimplements qemu-guest-agent interface query using go-libvirt interface.

Needed to query dhcp allocated IPs on bridged networks.

Testcase

I wanted to produce a decent reproducible test case so I generated an VM image (using alpine scripts) that runs qemu-guest-agent and configures a static IP that can be queried. See TestAccLibvirtDomain_NetworkInterfaceQemuGuestAgentStaticIP.

The VM test image in https://github.com/maseman/testvm-tflibvirt is generated with a workflow as a release asset. At ~100MB I thought it best NOT to add the file to terraform-provider-libvirt /testdata and instead setup a download in the testcase.

Alpine VMs like this (and with small overlay configurations) might be useful for other more complex test scenarios in the future.

remoe commented 2 years ago

I have created a test version with this fix: https://github.com/remoe/terraform-provider-libvirt/releases/tag/untagged-fb1e891272fa09d2d159

It works on my side.

ATTENTION: this not an official version. Use it only for testing.

remoe commented 2 years ago

Can anyone merge this with the above changes for next release?

dmacvicar commented 2 years ago

I have manually rebased and committed this.

I don't like the 120M image for the test, so the test is pending and I opened #913 to revisit it.