infra_code

infrastructure-as-code
git clone git://git.pyratebeard.net/infra_code.git
Log | Files | Refs | README

commit 1e3cd97b5f5dc7f04f8e3d196e53e296dcb765c3
parent 4a00e360b9f7e1a2153f6e91868c425638bbb271
Author: pyratebeard <root@pyratebeard.net>
Date:   Thu,  9 May 2024 15:30:22 +0100

libvirt | debian12 | use base volume for image and create new volume to allow size adjustments

Diffstat:
Mlibvirt/debian12/infra.tf | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/libvirt/debian12/infra.tf b/libvirt/debian12/infra.tf @@ -1,9 +1,16 @@ +resource "libvirt_volume" "base-debian12-qcow2" { + name = "debian-12-genericcloud-amd64.qcow2" + pool = "labfs" + source = "http://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2" + format = "qcow2" +} + resource "libvirt_volume" "debian12-qcow2" { name = "${var.vm_name}.qcow2" pool = "labfs" - source = "http://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2" format = "qcow2" - #size = var.vm_size + size = var.vm_size + base_volume_id = libvirt_volume.base-debian12-qcow2.id } data "template_file" "user_data" {