Skip to content

Commit ef24ad9

Browse files
Mehul3217NickElliot
authored andcommitted
add tiering_policy to volume replication create (GoogleCloudPlatform#13515)
1 parent c3c16b9 commit ef24ad9

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

mmv1/products/netapp/Volume.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ properties:
511511
- name: 'coolingThresholdDays'
512512
type: Integer
513513
description: |
514-
Optional. Time in days to mark the volume's data block as cold and make it eligible for tiering, can be range from 7-183.
514+
Optional. Time in days to mark the volume's data block as cold and make it eligible for tiering, can be range from 2-183.
515515
Default is 31.
516516
- name: 'tierAction'
517517
type: Enum

mmv1/products/netapp/VolumeReplication.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,27 @@ properties:
260260
description: |
261261
Description for the destination volume.
262262
immutable: true
263+
- name: 'tieringPolicy'
264+
type: NestedObject
265+
description: |-
266+
Tiering policy for the volume.
267+
update_mask_fields:
268+
- 'tiering_policy.cooling_threshold_days'
269+
- 'tiering_policy.tier_action'
270+
properties:
271+
- name: 'coolingThresholdDays'
272+
type: Integer
273+
description: |
274+
Optional. Time in days to mark the volume's data block as cold and make it eligible for tiering, can be range from 2-183.
275+
Default is 31.
276+
- name: 'tierAction'
277+
type: Enum
278+
description: |
279+
Optional. Flag indicating if the volume has tiering policy enable/pause. Default is PAUSED.
280+
default_value: "PAUSED"
281+
enum_values:
282+
- 'ENABLED'
283+
- 'PAUSED'
263284
- name: 'sourceVolume'
264285
type: String
265286
description: |

mmv1/templates/terraform/examples/netapp_volume_replication_create.tf.tmpl

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ resource "google_netapp_storage_pool" "destination_pool" {
1717
service_level = "PREMIUM"
1818
capacity_gib = 2048
1919
network = data.google_compute_network.default.id
20+
allow_auto_tiering = true
2021
}
2122

2223
resource "google_netapp_volume" "source_volume" {
@@ -45,6 +46,10 @@ resource "google_netapp_volume_replication" "{{$.PrimaryResourceId}}" {
4546
# simplifies implementing client failover concepts
4647
share_name = "{{index $.Vars "volume_name"}}"
4748
description = "This is a replicated volume"
49+
tiering_policy {
50+
cooling_threshold_days = 20
51+
tier_action = "ENABLED"
52+
}
4853
}
4954
# WARNING: Setting delete_destination_volume to true, will delete the
5055
# CURRENT destination volume if the replication is deleted. Omit the field

mmv1/third_party/terraform/services/netapp/resource_netapp_volume_replication_test.go

+20
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ resource "google_netapp_storage_pool" "destination_pool" {
8585
service_level = "PREMIUM"
8686
capacity_gib = 2048
8787
network = data.google_compute_network.default.id
88+
allow_auto_tiering = true
8889
}
8990
9091
resource "google_netapp_volume" "source_volume" {
@@ -112,6 +113,10 @@ resource "google_netapp_volume_replication" "test_replication" {
112113
# simplifies implementing client failover concepts
113114
share_name = "tf-test-source-volume%{random_suffix}"
114115
description = "This is a replicated volume"
116+
tiering_policy {
117+
cooling_threshold_days = 20
118+
tier_action = "ENABLED"
119+
}
115120
}
116121
delete_destination_volume = true
117122
wait_for_mirror = true
@@ -140,6 +145,7 @@ resource "google_netapp_storage_pool" "destination_pool" {
140145
service_level = "PREMIUM"
141146
capacity_gib = 2048
142147
network = data.google_compute_network.default.id
148+
allow_auto_tiering = true
143149
}
144150
145151
resource "google_netapp_volume" "source_volume" {
@@ -172,6 +178,10 @@ resource "google_netapp_volume_replication" "test_replication" {
172178
# simplifies implementing client failover concepts
173179
share_name = "tf-test-source-volume%{random_suffix}"
174180
description = "This is a replicated volume"
181+
tiering_policy {
182+
cooling_threshold_days = 20
183+
tier_action = "ENABLED"
184+
}
175185
}
176186
replication_enabled = true
177187
delete_destination_volume = true
@@ -202,6 +212,7 @@ resource "google_netapp_storage_pool" "destination_pool" {
202212
service_level = "PREMIUM"
203213
capacity_gib = 2048
204214
network = data.google_compute_network.default.id
215+
allow_auto_tiering = true
205216
}
206217
207218
resource "google_netapp_volume" "source_volume" {
@@ -234,6 +245,10 @@ resource "google_netapp_volume_replication" "test_replication" {
234245
# simplifies implementing client failover concepts
235246
share_name = "tf-test-source-volume%{random_suffix}"
236247
description = "This is a replicated volume"
248+
tiering_policy {
249+
cooling_threshold_days = 20
250+
tier_action = "ENABLED"
251+
}
237252
}
238253
replication_enabled = false
239254
delete_destination_volume = true
@@ -264,6 +279,7 @@ resource "google_netapp_storage_pool" "destination_pool" {
264279
service_level = "PREMIUM"
265280
capacity_gib = 2048
266281
network = data.google_compute_network.default.id
282+
allow_auto_tiering = true
267283
}
268284
269285
resource "google_netapp_volume" "source_volume" {
@@ -296,6 +312,10 @@ resource "google_netapp_volume_replication" "test_replication" {
296312
# simplifies implementing client failover concepts
297313
share_name = "tf-test-source-volume%{random_suffix}"
298314
description = "This is a replicated volume"
315+
tiering_policy {
316+
cooling_threshold_days = 20
317+
tier_action = "ENABLED"
318+
}
299319
}
300320
replication_enabled = true
301321
delete_destination_volume = true

0 commit comments

Comments
 (0)