41 lines
913 B
HCL
41 lines
913 B
HCL
resource "proxmox_vm_qemu" "vm1" {
|
|
name = "terraform-vm"
|
|
target_node = "nuctyzyzen7-1"
|
|
clone = "ubuntu-2404-template"
|
|
|
|
cpu {
|
|
cores = 2
|
|
sockets = 1
|
|
}
|
|
|
|
memory = 2048
|
|
|
|
disk {
|
|
slot = "scsi0"
|
|
size = "20G"
|
|
type = "disk"
|
|
storage = "zfs1"
|
|
}
|
|
# Cloud-init drive toevoegen
|
|
ide2 {
|
|
storage = "zfs1"
|
|
size = "4G"
|
|
type = "cloudinit"
|
|
}
|
|
network {
|
|
id = 0
|
|
model = "virtio"
|
|
bridge = "vmbr0"
|
|
}
|
|
|
|
os_type = "cloud-init"
|
|
ipconfig0 = "ip=dhcp"
|
|
ciuser = "ubuntu"
|
|
sshkeys = var.ssh_public_key
|
|
agent = 1
|
|
scsihw = "virtio-scsi-pci"
|
|
machine = "q35"
|
|
# cicustom = "user=local:snippets/user-data.yaml" # optioneel, voor custom cloud-init
|
|
ci_storage = "zfs1" # waar de cloud-init drive moet komen
|
|
ci_disk = 4 # grootte in GB
|
|
} |