26 lines
625 B
HCL
26 lines
625 B
HCL
# Base volume (template/parent)
|
|
resource "libvirt_volume" "base_vm_image" {
|
|
name = "${var.vm_name}-base"
|
|
pool = "${var.vm_name}-pool"
|
|
source = var.image_location
|
|
format = "qcow2"
|
|
|
|
depends_on = [
|
|
libvirt_pool.tf_tmp_storage
|
|
]
|
|
}
|
|
|
|
# Clone volume with resizable size
|
|
resource "libvirt_volume" "vm_disk" {
|
|
count = var.instance_count
|
|
name = "${var.vm_name}-${count.index}"
|
|
pool = "${var.vm_name}-pool"
|
|
format = "qcow2"
|
|
size = var.disk_size_bytes
|
|
base_volume_id = libvirt_volume.base_vm_image.id
|
|
|
|
depends_on = [
|
|
libvirt_volume.base_vm_image
|
|
]
|
|
}
|