[ ] Is your issue/contribution related with enabling some setting/option exposed by libvirt that the plugin does not yet support, or requires changing/extending the provider terraform schema?
[ ] Make sure you explain why this option is important to you, why it should be important to everyone. Describe your use-case with detail and provide examples where possible.
[ ] If it is a very special case, consider using the XSLT support in the provider to tweak the definition instead of opening an issue
[ ] Maintainers do not have expertise in every libvirt setting, so please, describe the feature and how it is used. Link to the appropriate documentation
[x] Is it a bug or something that does not work as expected? Please make sure you fill the version information below:
The issue I am facing is when libvirt_domain needs the cloudinit id. We are getting the cloud-init id in the creation time, before the ISO being uploaded into the final location.
and so I am getting messages like:
│ Error: error while retrieving remote ISO: error retrieving info for volume: Storage volume not found: no storage vol with matching name '_jX2xw_cloud-init.iso'
│
│ with libvirt_cloudinit_disk.cloud-init["k8scpnode"],
│ on Cloudinit.tf line 23, in resource "libvirt_cloudinit_disk" "cloud-init":
│ 23: resource "libvirt_cloudinit_disk" "cloud-init" {
│
As when the libvirt_domain starts to create the VM, the ISO is not yet in the uploaded directory!
Steps to Reproduce Issue
terraform apply
The weird thing is that, this bug is truly random that depends completely on many things, like cpu/mem/disk usage at the moment of terraform apply. Most of the times will create a single VM without an issue. When you are working building a a lab with many VMs then this issue becomes a really annoying bug.
Additional information:
A workaround, I was thinking, would be to return the cloud-init.iso id after a successful upload to libvirt and not in CreateIso but when UploadIso
fwiw it might be related to recent changes in libvirt that this tf provider is not catching up with - I reverted to libvirt 8.0.0 and this error is gone somehow.
System Information
Linux distribution
Archlinux
Terraform version
Provider and libvirt versions
Checklist
[ ] Is your issue/contribution related with enabling some setting/option exposed by libvirt that the plugin does not yet support, or requires changing/extending the provider terraform schema?
[x] Is it a bug or something that does not work as expected? Please make sure you fill the version information below:
Description of Issue/Question
Setup
So here is the issue,
from what I see (tf debug) is that cloud-init.iso is being created under a temp directory before "uploaded" to the libvirt image directory.
that's perfectly okay.
The issue I am facing is when libvirt_domain needs the cloudinit id. We are getting the cloud-init id in the creation time, before the ISO being uploaded into the final location.
and so I am getting messages like:
As when the libvirt_domain starts to create the VM, the ISO is not yet in the uploaded directory!
Steps to Reproduce Issue
The weird thing is that, this bug is truly random that depends completely on many things, like cpu/mem/disk usage at the moment of terraform apply. Most of the times will create a single VM without an issue. When you are working building a a lab with many VMs then this issue becomes a really annoying bug.
Additional information:
A workaround, I was thinking, would be to return the cloud-init.iso id after a successful upload to libvirt and not in CreateIso but when UploadIso
https://github.com/dmacvicar/terraform-provider-libvirt/blob/main/libvirt/cloudinit_def.go#L36
https://github.com/dmacvicar/terraform-provider-libvirt/blob/68c9bb05fd229efd70db0fe8cd0c1faef9c6e64f/libvirt/cloudinit_def.go#L110
PS 1. I am really sorry - have no idea about golang. PS 2. I hope what I wrote above makes some sense