terraform-libvirt/stack/computes.tf

42 lines
775 B
Terraform
Raw Normal View History

2020-07-28 21:45:32 +00:00
# https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/website/docs/r/domain.html.markdown
# Define KVM domain to create
resource "libvirt_domain" "db1" {
name = "db1"
memory = "1024"
vcpu = 1
running = "true"
2020-07-28 21:45:32 +00:00
autostart = "true"
boot_device {
dev = ["hd", "network"]
}
network_interface {
network_name = libvirt_network.private_network.name
2020-07-28 21:45:32 +00:00
}
disk {
volume_id = libvirt_volume.my_root_debian.id
2020-07-28 21:45:32 +00:00
}
# disk {
# volume_id = libvirt_volume.external_disk_1.id
# }
cloudinit = libvirt_cloudinit_disk.commoninit.id
console {
type = "pty"
target_type = "serial"
target_port = "0"
}
graphics {
type = "vnc"
listen_type = "address"
autoport = "true"
}
}