# https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/website/docs/r/domain.html.markdown # Define KVM domain to create resource "libvirt_domain" "domains" { name = format("db%s", count.index) memory = "1024" vcpu = 1 running = "true" autostart = "true" count = var.number_domain qemu_agent = true boot_device { dev = ["hd", "network"] } network_interface { network_id = libvirt_network.private_network.id hostname = format("compute-%s", count.index) } disk { volume_id = element(libvirt_volume.root_debian.*.id, count.index) } disk { volume_id = element(libvirt_volume.external_disk.*.id, count.index) } cloudinit = libvirt_cloudinit_disk.commoninit[count.index].id console { type = "pty" target_type = "serial" target_port = "0" } graphics { type = "vnc" listen_type = "address" autoport = "true" } }