-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_ai_gpu.tf
More file actions
123 lines (116 loc) · 2.81 KB
/
Copy pathmain_ai_gpu.tf
File metadata and controls
123 lines (116 loc) · 2.81 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
provider "oci" {}
data "oci_core_images" "gpu_images" {
compartment_id = var.compartment_ocid
operating_system = "Oracle Linux"
operating_system_version = "8"
shape = "VM.GPU.A10.1"
state = "AVAILABLE"
sort_by = "TIMECREATED"
sort_order = "DESC"
filter {
name = "launch_mode"
values = ["NATIVE"]
}
filter {
name = "display_name"
values = ["\\w*GPU\\w*"]
regex = true
}
}
data "template_file" "cloudinit" {
template = file("./cloudinit.sh")
vars = {
nvidia_api_key = var.nvidia_api_key
}
}
resource "oci_core_instance" "this" {
agent_config {
is_management_disabled = "false"
is_monitoring_disabled = "false"
plugins_config {
desired_state = "DISABLED"
name = "Vulnerability Scanning"
}
plugins_config {
desired_state = "DISABLED"
name = "Oracle Java Management Service"
}
plugins_config {
desired_state = "DISABLED"
name = "OS Management Service Agent"
}
plugins_config {
desired_state = "DISABLED"
name = "OS Management Hub Agent"
}
plugins_config {
desired_state = "DISABLED"
name = "Management Agent"
}
plugins_config {
desired_state = "ENABLED"
name = "Custom Logs Monitoring"
}
plugins_config {
desired_state = "DISABLED"
name = "Compute RDMA GPU Monitoring"
}
plugins_config {
desired_state = "ENABLED"
name = "Compute Instance Run Command"
}
plugins_config {
desired_state = "ENABLED"
name = "Compute Instance Monitoring"
}
plugins_config {
desired_state = "DISABLED"
name = "Compute HPC RDMA Auto-Configuration"
}
plugins_config {
desired_state = "DISABLED"
name = "Compute HPC RDMA Authentication"
}
plugins_config {
desired_state = "ENABLED"
name = "Cloud Guard Workload Protection"
}
plugins_config {
desired_state = "DISABLED"
name = "Block Volume Management"
}
plugins_config {
desired_state = "DISABLED"
name = "Bastion"
}
}
availability_config {
is_live_migration_preferred = "false"
recovery_action = "RESTORE_INSTANCE"
}
availability_domain = var.ad
compartment_id = var.compartment_ocid
create_vnic_details {
assign_ipv6ip = "false"
assign_private_dns_record = "true"
assign_public_ip = "true"
subnet_id = var.subnet_id
}
display_name = var.vm_display_name
instance_options {
are_legacy_imds_endpoints_disabled = "false"
}
is_pv_encryption_in_transit_enabled = "true"
metadata = {
ssh_authorized_keys = var.ssh_public_key
user_data = base64encode(data.template_file.cloudinit.rendered)
}
shape = "VM.GPU.A10.1"
source_details {
boot_volume_size_in_gbs = "250"
boot_volume_vpus_per_gb = "10"
source_id = data.oci_core_images.gpu_images.images[0].id
source_type = "image"
}
freeform_tags = {"GPU_TAG"= "A10-1"}
}