Skip to content

Commit 5b56869

Browse files
[BLOCK] Add storage pool type field (#15362)
1 parent ff29e5b commit 5b56869

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

mmv1/products/netapp/StoragePool.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import_format:
5555
timeouts:
5656
insert_minutes: 45
5757
update_minutes: 20
58-
delete_minutes: 20
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: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,3 +727,53 @@ 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.ProtoV5ProviderBetaFactories(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+
})
754+
}
755+
756+
func testAccNetappStoragePool_unifiedStoragePoolCreate(context map[string]interface{}) string {
757+
return acctest.Nprintf(`
758+
759+
data "google_compute_network" "default" {
760+
provider = google-beta
761+
name = "%{network_name}"
762+
}
763+
764+
resource "google_netapp_storage_pool" "test_pool" {
765+
provider = google-beta
766+
name = "tf-test-pool%{random_suffix}"
767+
location = "us-central1-a"
768+
service_level = "FLEX"
769+
type = "UNIFIED"
770+
capacity_gib = "2048"
771+
network = data.google_compute_network.default.id
772+
description = "this is a test description"
773+
labels = {
774+
key = "test"
775+
value = "pool"
776+
}
777+
}
778+
`, context)
779+
}

0 commit comments

Comments
 (0)