Skip to content

Commit 45a9c99

Browse files
Reservation Affinity for workbench instances (#13328) (#1055)
[upstream:ccc0df0c84d9cba5dbd53a7e02b1b63265f632d1] Signed-off-by: Modular Magician <[email protected]>
1 parent a8bf2e7 commit 45a9c99

File tree

1 file changed

+28
-0
lines changed
  • workbench_instance_basic_gpu

1 file changed

+28
-0
lines changed

workbench_instance_basic_gpu/main.tf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
resource "google_compute_reservation" "gpu_reservation" {
2+
name = "wbi-reservation-${local.name_suffix}"
3+
zone = "us-central1-a"
4+
5+
specific_reservation {
6+
count = 1
7+
8+
instance_properties {
9+
machine_type = "n1-standard-1"
10+
11+
guest_accelerators {
12+
accelerator_type = "nvidia-tesla-t4"
13+
accelerator_count = 1
14+
}
15+
}
16+
}
17+
18+
specific_reservation_required = false
19+
}
20+
121
resource "google_workbench_instance" "instance" {
222
name = "workbench-instance-${local.name_suffix}"
323
location = "us-central1-a"
@@ -11,5 +31,13 @@ resource "google_workbench_instance" "instance" {
1131
project = "cloud-notebooks-managed"
1232
family = "workbench-instances"
1333
}
34+
reservation_affinity {
35+
consume_reservation_type = "RESERVATION_ANY"
36+
}
1437
}
38+
39+
depends_on = [
40+
google_compute_reservation.gpu_reservation
41+
]
42+
1543
}

0 commit comments

Comments
 (0)