diff --git a/terraform/main.tf b/terraform/main.tf index 8f3a0ea..68c799d 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -1,23 +1,32 @@ -resource "proxmox_vm_qemu" "vm1" { +resource "proxmox_vm_qemu" "ubuntu2404" { name = "terraform-vm" target_node = "nuctyzyzen7-1" - full_clone = true - cpu { - cores = 2 - sockets = 1 - } - memory = 2048 + + cores = 2 + sockets = 1 + memory = 4096 scsihw = "virtio-scsi-pci" machine = "q35" + agent = 1 - # Bootdisk cloned from template + # Bootdisk vanaf cloud image disk { - slot = "virtio0" + slot = "scsi0" type = "disk" storage = "zfs1" - size = "32G" + size = "20G" + format = "qcow2" cache = "writeback" discard = true + # Als je image al geüpload is, kun je clone= gebruiken + # clone = "999/virtio0" + } + + # Cloud-init drive + disk { + slot = "scsi1" + type = "cdrom" + storage = "zfs1" } network { @@ -26,12 +35,11 @@ resource "proxmox_vm_qemu" "vm1" { bridge = "vmbr0" } - # Cloud-init + # Cloud-init configuratie + os_type = "cloud-init" ciuser = "martijn" cipassword = "Gwh28dgcmp!" ipconfig0 = "ip=dhcp" searchdomain = "domain.local" nameserver = "192.168.178.1" - - agent = 1 }