diff options
| author | jerome <jerome@xlinfo.fr> | 2025-02-04 15:02:50 +0100 |
|---|---|---|
| committer | jerome <jerome@xlinfo.fr> | 2025-02-04 15:02:50 +0100 |
| commit | 2a485c2921146c76023e8dabbaa6d4bedee1aa7b (patch) | |
| tree | 926f6f658ddfcc3dec44702c76b70cc4dcd08ffd /libvirt.tf | |
| parent | 3b3f35127f2cfa7e08d943a0555c095ad553021f (diff) | |
| download | kvm-2a485c2921146c76023e8dabbaa6d4bedee1aa7b.tar.gz kvm-2a485c2921146c76023e8dabbaa6d4bedee1aa7b.zip | |
resize bse image
Diffstat (limited to 'libvirt.tf')
| -rw-r--r-- | libvirt.tf | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -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 |
