[x] 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] 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.
[x] If it is a very special case, consider using the XSLT support in the provider to tweak the definition instead of opening an issue
[x] 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:
Description of Issue/Question
As an administrator setting up multiple environments, I don't want to centralize all of my Terraform configurations in a single set of configuration files. Instead, I'd like to split them up into applications or stages. This means I can re-deploy or destroy one application without affecting others. Doing this with this provider is very annoying and difficult. I now have to do manual tasks which is against the design of IaC.
Please implement Terraform Data Source blocks so I can reference a pre-generated resource. This allows for:
Include existing resources when defining new resources outlined in the current configurations
Prevent the manual work of searching for each resource I want to include and import each before running any other task.
Run terraform apply -destroy if needing to remove an application without worrying about removing system-wide resources. Currently, this can only be done manually.
For example, if I want to deploy a set of domains on an existing system, I should be able to reference existing resources to quickly create it:
terraform {
required_version = ">= 1.0"
required_providers {
libvirt = {
source = "dmacvicar/libvirt"
}
}
}
provider "libvirt" {
uri = "qemu:///system"
}
# System Resources
data "libvirt_pool" "os_iso" {
name = "os_iso"
}
data "libvirt_pool" "os_disks" {
name = "os_disks"
}
data "libvirt_volume" "ubuntu" {
name = "ubuntu-20.04-server-cloudimg-amd64-disk-kvm.img"
pool = data.libvirt_pool.os_iso.id
}
# Application Resources
resource "libvirt_volume" "root" {
name = "app_root.qcow2"
pool = data.libvirt_pool.os_disks.name
size = 107374182400
base_volume_id = data.libvirt_volume.ubuntu_cloudinit.id
}
Terraform version
v1.0.6
Provider and libvirt versions
v1.43.1
Checklist
[x] 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] 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.
[x] If it is a very special case, consider using the XSLT support in the provider to tweak the definition instead of opening an issue
[x] 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:
Description of Issue/Question
As an administrator setting up multiple environments, I don't want to centralize all of my Terraform configurations in a single set of configuration files. Instead, I'd like to split them up into applications or stages. This means I can re-deploy or destroy one application without affecting others. Doing this with this provider is very annoying and difficult. I now have to do manual tasks which is against the design of IaC.
Please implement Terraform Data Source blocks so I can reference a pre-generated resource. This allows for:
import
each before running any other task.terraform apply -destroy
if needing to remove an application without worrying about removing system-wide resources. Currently, this can only be done manually.For example, if I want to deploy a set of domains on an existing system, I should be able to reference existing resources to quickly create it: