-
Notifications
You must be signed in to change notification settings - Fork 25
/
cluster-network-configuration.tf
executable file
·84 lines (75 loc) · 3.07 KB
/
cluster-network-configuration.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
resource "oci_core_instance_configuration" "cluster-network-instance_configuration" {
count = (!var.compute_cluster) && var.cluster_network ? 1 : 0
depends_on = [oci_core_app_catalog_subscription.mp_image_subscription]
compartment_id = var.targetCompartment
display_name = local.cluster_name
instance_details {
instance_type = "compute"
launch_details {
availability_domain = var.ad
compartment_id = var.targetCompartment
create_vnic_details {
}
display_name = local.cluster_name
freeform_tags = {
"cluster_name" = local.cluster_name
"parent_cluster" = local.cluster_name
}
metadata = {
# TODO: add user key to the authorized_keys
ssh_authorized_keys = "${var.ssh_key}\n${tls_private_key.ssh.public_key_openssh}"
user_data = base64encode(data.template_file.config.rendered)
}
agent_config {
are_all_plugins_disabled = false
is_management_disabled = true
is_monitoring_disabled = false
plugins_config {
desired_state = "DISABLED"
name = "OS Management Service Agent"
}
dynamic "plugins_config" {
for_each = var.use_compute_agent ? ["ENABLED"] : ["DISABLED"]
content {
name = "Compute HPC RDMA Authentication"
desired_state = plugins_config.value
}
}
dynamic "plugins_config" {
for_each = var.use_compute_agent ? ["ENABLED"] : ["DISABLED"]
content {
name = "Compute HPC RDMA Auto-Configuration"
desired_state = plugins_config.value
}
}
dynamic "plugins_config" {
for_each = length(regexall(".*GPU.*", var.cluster_network_shape)) > 0 ? ["ENABLED"] : ["DISABLED"]
content {
name = "Compute RDMA GPU Monitoring"
desired_state = plugins_config.value
}
}
}
dynamic "platform_config" {
for_each = var.BIOS ? range(1) : []
content {
type = local.platform_type
are_virtual_instructions_enabled = var.virt_instr
is_access_control_service_enabled = var.access_ctrl
is_input_output_memory_management_unit_enabled = var.IOMMU
is_symmetric_multi_threading_enabled = var.SMT
numa_nodes_per_socket = var.numa_nodes_per_socket == "Default" ? (local.platform_type == "GENERIC_BM" ? "NPS1" : "NPS4") : var.numa_nodes_per_socket
percentage_of_cores_enabled = var.percentage_of_cores_enabled == "Default" ? 100 : tonumber(var.percentage_of_cores_enabled)
}
}
shape = var.cluster_network_shape
source_details {
source_type = "image"
boot_volume_size_in_gbs = var.boot_volume_size
boot_volume_vpus_per_gb = 30
image_id = local.cluster_network_image
}
}
}
source = "NONE"
}