Skip to content

Commit 6804a46

Browse files
Cezarus27Dawid212
authored andcommitted
Feature gap: Add workload_policy field (GoogleCloudPlatform#13341)
Signed-off-by: Cezary Sobczak <[email protected]>
1 parent 75e366a commit 6804a46

4 files changed

+76
-0
lines changed

mmv1/products/compute/ResourcePolicy.yaml

+50
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,21 @@ examples:
7878
primary_resource_id: 'cgroup'
7979
vars:
8080
name: 'gce-policy'
81+
- name: 'resource_policy_workload_policy'
82+
primary_resource_id: 'bar'
83+
min_version: 'beta'
84+
vars:
85+
name: 'gce-policy'
86+
- name: 'resource_policy_workload_policy_accelerator_topology'
87+
primary_resource_id: 'bar'
88+
min_version: 'beta'
89+
vars:
90+
name: 'gce-policy'
91+
- name: 'resource_policy_workload_policy_max_topology_distance'
92+
primary_resource_id: 'bar'
93+
min_version: 'beta'
94+
vars:
95+
name: 'gce-policy'
8196
- name: 'resource_policy_placement_policy_gpu_topology'
8297
primary_resource_id: 'baz'
8398
min_version: 'beta'
@@ -383,3 +398,38 @@ properties:
383398
Enable disk consistency on the resource policy.
384399
required: true
385400
immutable: true
401+
- name: 'workloadPolicy'
402+
type: NestedObject
403+
description: |
404+
Represents the workload policy.
405+
min_version: 'beta'
406+
properties:
407+
- name: 'type'
408+
type: Enum
409+
description: |
410+
The type of workload policy.
411+
immutable: true
412+
required: true
413+
enum_values:
414+
- 'HIGH_AVAILABILITY'
415+
- 'HIGH_THROUGHPUT'
416+
- name: 'maxTopologyDistance'
417+
type: Enum
418+
description: |
419+
The maximum topology distance. This field can be set only when the workload policy type is HIGH_THROUGHPUT
420+
and cannot be set if accelerator topology is set.
421+
immutable: true
422+
enum_values:
423+
- 'BLOCK'
424+
- 'CLUSTER'
425+
- 'SUBBLOCK'
426+
conflicts:
427+
- 'workload_policy.0.accelerator_topology'
428+
- name: 'acceleratorTopology'
429+
type: String
430+
description: |
431+
The accelerator topology. This field can be set only when the workload policy type is HIGH_THROUGHPUT
432+
and cannot be set if max topology distance is set.
433+
immutable: true
434+
conflicts:
435+
- 'workload_policy.0.max_topology_distance'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "google_compute_resource_policy" "bar" {
2+
name = "{{index $.Vars "name"}}"
3+
region = "europe-west1"
4+
provider = google-beta
5+
workload_policy {
6+
type = "HIGH_AVAILABILITY"
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
resource "google_compute_resource_policy" "bar" {
2+
name = "{{index $.Vars "name"}}"
3+
region = "europe-west1"
4+
provider = google-beta
5+
workload_policy {
6+
type = "HIGH_THROUGHPUT"
7+
accelerator_topology = "SOME NEW TOPOLOGY"
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
resource "google_compute_resource_policy" "bar" {
2+
name = "{{index $.Vars "name"}}"
3+
region = "europe-west1"
4+
provider = google-beta
5+
workload_policy {
6+
type = "HIGH_THROUGHPUT"
7+
max_topology_distance = "BLOCK"
8+
}
9+
}

0 commit comments

Comments
 (0)