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
|
2020-08-05 22:34:05 +00:00
|
|
|
running = "true"
|
2020-07-28 21:45:32 +00:00
|
|
|
autostart = "true"
|
|
|
|
|
|
|
|
boot_device {
|
|
|
|
dev = ["hd", "network"]
|
|
|
|
}
|
|
|
|
|
|
|
|
network_interface {
|
2020-08-05 22:34:05 +00:00
|
|
|
network_name = libvirt_network.private_network.name
|
2020-07-28 21:45:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
disk {
|
2020-08-05 22:34:05 +00:00
|
|
|
volume_id = libvirt_volume.my_root_debian.id
|
2020-07-28 21:45:32 +00:00
|
|
|
}
|
|
|
|
|
2020-08-10 23:05:35 +00:00
|
|
|
disk {
|
|
|
|
volume_id = libvirt_volume.external_disk_1.id
|
|
|
|
}
|
2020-07-28 21:45:32 +00:00
|
|
|
|
|
|
|
cloudinit = libvirt_cloudinit_disk.commoninit.id
|
|
|
|
|
|
|
|
console {
|
|
|
|
type = "pty"
|
|
|
|
target_type = "serial"
|
|
|
|
target_port = "0"
|
|
|
|
}
|
|
|
|
|
|
|
|
graphics {
|
|
|
|
type = "vnc"
|
|
|
|
listen_type = "address"
|
|
|
|
autoport = "true"
|
|
|
|
}
|
|
|
|
}
|