Skip to content

Commit d1a715b

Browse files
[BLOCK] Add storage pool type field (#15415)
1 parent c9e576e commit d1a715b

File tree

2 files changed

+96
-2
lines changed

2 files changed

+96
-2
lines changed

mmv1/products/netapp/StoragePool.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ import_format:
5454
- 'projects/{{project}}/locations/{{location}}/storagePools/{{name}}'
5555
timeouts:
5656
insert_minutes: 45
57-
update_minutes: 20
58-
delete_minutes: 20
57+
update_minutes: 60
58+
delete_minutes: 45
5959
autogen_async: true
6060
async:
6161
actions: ['create', 'delete', 'update']
@@ -184,6 +184,7 @@ properties:
184184
type: Boolean
185185
description: |
186186
Optional. True if using Independent Scaling of capacity and performance (Hyperdisk). Default is false.
187+
default_from_api: true
187188
immutable: true
188189
- name: 'totalThroughputMibps'
189190
type: String
@@ -232,3 +233,15 @@ properties:
232233
description: |
233234
Total hot tier data rounded down to the nearest GiB used by the storage pool.
234235
output: true
236+
- name: 'type'
237+
type: Enum
238+
description: |
239+
Type of the storage pool.
240+
This field is used to control whether the pool supports FILE based volumes only or UNIFIED (both FILE and BLOCK) volumes.
241+
If not specified during creation, it defaults to FILE.
242+
enum_values:
243+
- 'STORAGE_POOL_TYPE_UNSPECIFIED'
244+
- 'FILE'
245+
- 'UNIFIED'
246+
immutable: true
247+
default_from_api: true

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

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,3 +727,84 @@ data "google_compute_network" "default" {
727727
}
728728
`, context)
729729
}
730+
731+
func TestAccNetappStoragePool_unifiedStoragePoolCreate(t *testing.T) {
732+
t.Parallel()
733+
734+
context := map[string]interface{}{
735+
"network_name": acctest.BootstrapSharedServiceNetworkingConnection(t, "gcnv-network-config-3", acctest.ServiceNetworkWithParentService("netapp.servicenetworking.goog")),
736+
"random_suffix": acctest.RandString(t, 10),
737+
}
738+
739+
acctest.VcrTest(t, resource.TestCase{
740+
PreCheck: func() { acctest.AccTestPreCheck(t) },
741+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
742+
Steps: []resource.TestStep{
743+
{
744+
Config: testAccNetappStoragePool_unifiedStoragePoolCreate(context),
745+
},
746+
{
747+
ResourceName: "google_netapp_storage_pool.test_pool",
748+
ImportState: true,
749+
ImportStateVerify: true,
750+
ImportStateVerifyIgnore: []string{"location", "name", "labels", "terraform_labels"},
751+
},
752+
{
753+
Config: testAccNetappStoragePool_unifiedStoragePoolCreate_update(context),
754+
},
755+
{
756+
ResourceName: "google_netapp_storage_pool.test_pool",
757+
ImportState: true,
758+
ImportStateVerify: true,
759+
ImportStateVerifyIgnore: []string{"location", "name", "labels", "terraform_labels"},
760+
},
761+
},
762+
})
763+
}
764+
765+
func testAccNetappStoragePool_unifiedStoragePoolCreate(context map[string]interface{}) string {
766+
return acctest.Nprintf(`
767+
768+
data "google_compute_network" "default" {
769+
name = "%{network_name}"
770+
}
771+
772+
resource "google_netapp_storage_pool" "test_pool" {
773+
name = "tf-test-pool%{random_suffix}"
774+
location = "us-central1-a"
775+
service_level = "FLEX"
776+
type = "UNIFIED"
777+
capacity_gib = "2048"
778+
network = data.google_compute_network.default.id
779+
description = "this is a test description"
780+
labels = {
781+
key = "test"
782+
value = "pool"
783+
}
784+
}
785+
`, context)
786+
}
787+
788+
func testAccNetappStoragePool_unifiedStoragePoolCreate_update(context map[string]interface{}) string {
789+
return acctest.Nprintf(`
790+
791+
data "google_compute_network" "default" {
792+
name = "%{network_name}"
793+
}
794+
795+
resource "google_netapp_storage_pool" "test_pool" {
796+
name = "tf-test-pool%{random_suffix}"
797+
location = "us-central1-a"
798+
service_level = "FLEX"
799+
type = "UNIFIED"
800+
capacity_gib = "2048"
801+
network = data.google_compute_network.default.id
802+
description = "this is a test description"
803+
labels = {
804+
key = "test"
805+
value = "pool"
806+
}
807+
total_throughput_mibps = "200"
808+
}
809+
`, context)
810+
}

0 commit comments

Comments
 (0)