From 2a485c2921146c76023e8dabbaa6d4bedee1aa7b Mon Sep 17 00:00:00 2001 From: jerome Date: Tue, 4 Feb 2025 15:02:50 +0100 Subject: resize bse image --- libvirt.tf | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'libvirt.tf') diff --git a/libvirt.tf b/libvirt.tf index c7cbb5a..d63f72b 100644 --- a/libvirt.tf +++ b/libvirt.tf @@ -1,11 +1,18 @@ # Defining VM Volume -resource "libvirt_volume" "qcow2_vol" { - name = "${var.nom}.qcow2" +resource "libvirt_volume" "base" { + name = "${var.nom}-base" pool = "default" source = var.image format = "qcow2" } +resource "libvirt_volume" "image" { + name = "${var.nom}.qcow2" + base_volume_id = libvirt_volume.base.id + pool = "default" + size = 10 * 1024 * 1024 *1024 +} + # get user data info data "template_file" "user_data" { template = file("${path.module}/cloud_init.cfg") @@ -35,13 +42,13 @@ resource "libvirt_domain" "vm_domain" { } network_interface { - #network_name = "default" - bridge = "bridge0" + network_name = "default" + #bridge = "bridge0" wait_for_lease = true } disk { - volume_id = libvirt_volume.qcow2_vol.id + volume_id = libvirt_volume.image.id } cloudinit = libvirt_cloudinit_disk.commoninit.id -- cgit v1.2.3