42 lines
769 B
HCL
42 lines
769 B
HCL
# 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"
|
|
autostart = "true"
|
|
|
|
boot_device {
|
|
dev = ["hd", "network"]
|
|
}
|
|
|
|
network_interface {
|
|
network_name = libvirt_network.private_network.name
|
|
}
|
|
|
|
disk {
|
|
volume_id = libvirt_volume.my_root_debian.id
|
|
}
|
|
|
|
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"
|
|
}
|
|
}
|