33 lines
582 B
HCL
33 lines
582 B
HCL
resource "libvirt_domain" "domain" {
|
|
count = var.instance_count
|
|
name = "${var.vm_name}-${count.index}"
|
|
memory = var.memory
|
|
vcpu = var.vcpu
|
|
cloudinit = libvirt_cloudinit_disk.commoninit.id
|
|
cpu {
|
|
mode = "host-model"
|
|
}
|
|
|
|
disk {
|
|
volume_id = element(libvirt_volume.vm_disk.*.id, count.index)
|
|
}
|
|
|
|
console {
|
|
type = "pty"
|
|
target_port = "0"
|
|
target_type = "virtio"
|
|
}
|
|
|
|
video {
|
|
type = "virtio"
|
|
}
|
|
|
|
tpm {
|
|
backend_type = "emulator"
|
|
backend_version = "2.0"
|
|
}
|
|
|
|
network_interface {
|
|
network_name = var.network_name
|
|
}
|
|
} |