The ability to pull in existing resources via import exists. This is useful and good, until you have to destroy a component, or need to terminate a VM without destroying other resources that are managed elsewhere.
Ideally, I should be able to create a data source in the project:
For example, a volume...
data "libvirt_volume" "backing-volume" {
pool = "images"
name = "ubuntu-20.04-server.img"
}
The risk faced in importing the resources is that a careless terraform destroy can wipe out a shared resource like a network or pool. I may have multiple systems relying on the same backing image, which are not all handled by the same terraform plan. Or, I may have another project in TF that manages available images on the source system directly, and want to reference the named versions directly instead of downloading them to the KVM host.
System Information
Linux distribution
Ubuntu..
Terraform version
Provider and libvirt versions
Libvirt 6.0.0 (Ubuntu 20.04.5 LTS)
Description of Issue/Question
The ability to pull in existing
resources
via import exists. This is useful and good, until you have to destroy a component, or need to terminate a VM without destroying other resources that are managed elsewhere.Ideally, I should be able to create a data source in the project:
For example, a volume...
The risk faced in importing the resources is that a careless
terraform destroy
can wipe out a shared resource like a network or pool. I may have multiple systems relying on the same backing image, which are not all handled by the same terraform plan. Or, I may have another project in TF that manages available images on the source system directly, and want to reference the named versions directly instead of downloading them to the KVM host.