34 lines
619 B
HCL
34 lines
619 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-passthrough"
|
|
}
|
|
|
|
disk {
|
|
volume_id = element(libvirt_volume.vm_disk.*.id, count.index)
|
|
scsi = "true"
|
|
}
|
|
|
|
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.vm_name}-network"
|
|
}
|
|
} |