Skip to content

Commit 214ebd8

Browse files
authored
added qos support (#14929)
1 parent ed24432 commit 214ebd8

File tree

3 files changed

+120
-1
lines changed

3 files changed

+120
-1
lines changed

mmv1/products/netapp/StoragePool.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ properties:
189189
type: String
190190
description: |
191191
Optional. Custom Performance Total Throughput of the pool (in MiB/s).
192+
default_from_api: true
192193
- name: 'totalIops'
193194
type: String
194195
description: |
@@ -207,3 +208,17 @@ properties:
207208
Flag indicating that the hot-tier threshold will be auto-increased by 10% of the hot-tier when it hits 100%. Default is true.
208209
The increment will kick in only if the new size after increment is still less than or equal to storage pool size.
209210
min_version: 'beta'
211+
- name: 'qosType'
212+
type: Enum
213+
description: |
214+
QoS (Quality of Service) type of the storage pool.
215+
Possible values are: AUTO, MANUAL.
216+
enum_values:
217+
- 'QOS_TYPE_UNSPECIFIED'
218+
- 'AUTO'
219+
- 'MANUAL'
220+
- name: 'availableThroughputMibps'
221+
type: Double
222+
description: |
223+
Available throughput of the storage pool (in MiB/s).
224+
output: true

mmv1/products/netapp/Volume.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,3 +567,8 @@ properties:
567567
description: |
568568
Optional. Labels to be added to the replication as the key value pairs.
569569
An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
570+
- name: 'throughputMibps'
571+
type: Double
572+
description: |
573+
Optional. Custom Performance Total Throughput of the pool (in MiB/s).
574+
default_from_api: true

mmv1/third_party/terraform/services/netapp/resource_netapp_volume_test.go.tmpl

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,6 @@ data "google_compute_network" "default" {
760760
`, context)
761761
}
762762

763-
764763
{{ if ne $.TargetVersionName `ga` -}}
765764
func TestAccNetappVolume_flexAutoTierNetappVolume_update(t *testing.T) {
766765
context := map[string]interface{}{
@@ -871,4 +870,104 @@ data "google_compute_network" "default" {
871870
}
872871
`, context)
873872
}
873+
874+
func TestAccNetappStoragePool_ManualQos(t *testing.T) {
875+
context := map[string]interface{}{
876+
"network_name": acctest.BootstrapSharedServiceNetworkingConnection(t, "gcnv-network-config-3", acctest.ServiceNetworkWithParentService("netapp.servicenetworking.goog")),
877+
"random_suffix": acctest.RandString(t, 10),
878+
}
879+
880+
acctest.VcrTest(t, resource.TestCase{
881+
PreCheck: func() { acctest.AccTestPreCheck(t) },
882+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
883+
CheckDestroy: testAccCheckNetappVolumeDestroyProducer(t),
884+
ExternalProviders: map[string]resource.ExternalProvider{
885+
"time": {},
886+
},
887+
Steps: []resource.TestStep{
888+
{
889+
Config: testAccNetappVolume_ManualQosAuto(context),
890+
},
891+
{
892+
ResourceName: "google_netapp_volume.test_volume",
893+
ImportState: true,
894+
ImportStateVerify: true,
895+
ImportStateVerifyIgnore: []string{"restore_parameters", "location", "name", "deletion_policy", "labels", "terraform_labels"},
896+
},
897+
{
898+
Config: testAccNetappVolume_ManualQosManual(context),
899+
},
900+
{
901+
ResourceName: "google_netapp_volume.test_volume",
902+
ImportState: true,
903+
ImportStateVerify: true,
904+
ImportStateVerifyIgnore: []string{"restore_parameters", "location", "name", "deletion_policy", "labels", "terraform_labels"},
905+
},
906+
},
907+
})
908+
}
909+
910+
func testAccNetappVolume_ManualQosAuto(context map[string]interface{}) string {
911+
return acctest.Nprintf(`
912+
resource "google_netapp_storage_pool" "test_pool" {
913+
name = "tf-test-pool%{random_suffix}"
914+
location = "us-east4"
915+
service_level = "EXTREME"
916+
capacity_gib = "2048"
917+
network = data.google_compute_network.default.id
918+
qos_type = "AUTO"
919+
}
920+
921+
resource "time_sleep" "wait_3_minutes" {
922+
depends_on = [google_netapp_storage_pool.test_pool]
923+
create_duration = "3m"
924+
}
925+
926+
resource "google_netapp_volume" "test_volume" {
927+
location = "us-east4"
928+
name = "tf-test-test-volume%{random_suffix}"
929+
capacity_gib = "100"
930+
share_name = "tf-test-test-volume%{random_suffix}"
931+
storage_pool = google_netapp_storage_pool.test_pool.name
932+
protocols = ["NFSV3"]
933+
}
934+
935+
data "google_compute_network" "default" {
936+
name = "%{network_name}"
937+
}
938+
`, context)
939+
}
940+
941+
func testAccNetappVolume_ManualQosManual(context map[string]interface{}) string {
942+
return acctest.Nprintf(`
943+
resource "google_netapp_storage_pool" "test_pool" {
944+
name = "tf-test-pool%{random_suffix}"
945+
location = "us-east4"
946+
service_level = "EXTREME"
947+
capacity_gib = "2048"
948+
network = data.google_compute_network.default.id
949+
qos_type = "MANUAL"
950+
}
951+
952+
resource "time_sleep" "wait_3_minutes" {
953+
depends_on = [google_netapp_storage_pool.test_pool]
954+
create_duration = "3m"
955+
}
956+
957+
resource "google_netapp_volume" "test_volume" {
958+
location = "us-east4"
959+
name = "tf-test-test-volume%{random_suffix}"
960+
capacity_gib = "100"
961+
description = "This is a test description for manual qos volume"
962+
share_name = "tf-test-test-volume%{random_suffix}"
963+
storage_pool = google_netapp_storage_pool.test_pool.name
964+
protocols = ["NFSV3"]
965+
throughput_mibps = 12.5
966+
}
967+
968+
data "google_compute_network" "default" {
969+
name = "%{network_name}"
970+
}
971+
`, context)
972+
}
874973
{{ end }}

0 commit comments

Comments
 (0)