-
Notifications
You must be signed in to change notification settings - Fork 0
/
domain_ol8.tf
55 lines (53 loc) · 1.29 KB
/
domain_ol8.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
locals {
domain_name_domain_ol8 = "ol8"
}
resource "libvirt_volume" "vol_ol8" {
count = var.domains_count_ol8
name = format("%s-%s", local.domain_name_domain_ol8, count.index)
base_volume_id = libvirt_volume.oracle_linux8.0.id
size = 53687091200 # 50gb
base_volume_pool = var.default_pool_name
}
resource "libvirt_domain" "domain_ol8" {
count = var.domains_count_ol8
name = format("%s-%s", local.domain_name_domain_ol8, count.index)
cloudinit = libvirt_cloudinit_disk.cloud_init.id
arch = "x86_64"
vcpu = var.vcpu
memory = var.memory
autostart = var.autostart
qemu_agent = false
disk {
volume_id = libvirt_volume.vol_ol8[count.index].id
scsi = "true"
}
network_interface {
network_id = libvirt_network.network.id
hostname = format("%s-%s", local.domain_name_domain_ol8, count.index)
}
graphics {
type = "vnc"
listen_type = "address"
autoport = true
}
video {
type = "virtio"
}
console {
type = "pty"
target_port = "0"
target_type = "serial"
}
console {
type = "pty"
target_type = "virtio"
target_port = "1"
}
cpu {
mode = "host-passthrough"
}
boot_device {
dev = ["hd"]
}
# cmdline = var.cmdline
}