@@ -96,7 +96,6 @@ func testAccCheckIBMPIInstanceDeploymentTypeConfig(name, instanceHealthStatus, e
9696 pi_network {
9797 network_id = data.ibm_pi_network.power_networks.id
9898 }
99-
10099 }
101100 ` , acc .Pi_cloud_instance_id , name , acc .Pi_image , acc .Pi_network_name , instanceHealthStatus , epic , systype , acc .PiStorageType )
102101}
@@ -133,7 +132,6 @@ func testAccCheckIBMPIInstanceIBMiLicense(name, instanceHealthStatus string, IBM
133132 pi_network {
134133 network_id = data.ibm_pi_network.power_networks.id
135134 }
136-
137135 }` , acc .Pi_cloud_instance_id , name , acc .Pi_image , acc .Pi_network_name , instanceHealthStatus , IBMiCSS , IBMiRDSUsers )
138136}
139137
@@ -255,7 +253,31 @@ func testAccCheckIBMPIInstanceDeplomentTargetConfig(name string) string {
255253 }
256254 ` , acc .Pi_cloud_instance_id , name , acc .Pi_image , acc .Pi_network_name )
257255}
258-
256+ func testAccCheckIBMPIInstanceStorageConnectionConfig (name , instanceHealthStatus string ) string {
257+ return fmt .Sprintf (`
258+ resource "ibm_pi_volume" "power_volume" {
259+ pi_cloud_instance_id = "%[1]s"
260+ pi_volume_size = 1
261+ pi_volume_name = "%[2]s"
262+ pi_volume_type = "tier3"
263+ }
264+ resource "ibm_pi_instance" "power_instance" {
265+ pi_cloud_instance_id = "%[1]s"
266+ pi_memory = "2"
267+ pi_processors = "1"
268+ pi_instance_name = "%[2]s"
269+ pi_proc_type = "shared"
270+ pi_image_id = "%[3]s"
271+ pi_sys_type = "s922"
272+ pi_network {
273+ network_id = "%[4]s"
274+ }
275+ pi_storage_connection = "%[5]s"
276+ pi_health_status = "%[6]s"
277+ pi_volume_ids = [ibm_pi_volume.power_volume.volume_id]
278+ }
279+ ` , acc .Pi_cloud_instance_id , name , acc .Pi_image , acc .Pi_network_name , acc .Pi_storage_connection , instanceHealthStatus )
280+ }
259281func testAccCheckIBMPIInstanceDestroy (s * terraform.State ) error {
260282 sess , err := acc .TestAccProvider .Meta ().(conns.ClientSession ).IBMPISession ()
261283 if err != nil {
@@ -336,6 +358,25 @@ func TestAccIBMPIInstanceBasic(t *testing.T) {
336358 },
337359 })
338360}
361+ func TestAccIBMPIInstanceStorageConnection (t * testing.T ) {
362+ instanceRes := "ibm_pi_instance.power_instance"
363+ name := fmt .Sprintf ("tf-pi-instance-%d" , acctest .RandIntRange (10 , 100 ))
364+ resource .Test (t , resource.TestCase {
365+ PreCheck : func () { acc .TestAccPreCheck (t ) },
366+ Providers : acc .TestAccProviders ,
367+ CheckDestroy : testAccCheckIBMPIInstanceDestroy ,
368+ Steps : []resource.TestStep {
369+ {
370+ Config : testAccCheckIBMPIInstanceStorageConnectionConfig (name , power .OK ),
371+ Check : resource .ComposeTestCheckFunc (
372+ testAccCheckIBMPIInstanceExists (instanceRes ),
373+ resource .TestCheckResourceAttr (instanceRes , "pi_instance_name" , name ),
374+ resource .TestCheckResourceAttr (instanceRes , "pi_storage_connection" , acc .Pi_storage_connection ),
375+ ),
376+ },
377+ },
378+ })
379+ }
339380func TestAccIBMPIInstanceDeploymentTarget (t * testing.T ) {
340381 instanceRes := "ibm_pi_instance.power_instance"
341382 name := fmt .Sprintf ("tf-pi-instance-%d" , acctest .RandIntRange (10 , 100 ))
@@ -526,7 +567,7 @@ func testAccIBMPISAPInstanceConfig(name, sapProfile string) string {
526567 pi_storage_type = "tier1"
527568 pi_network {
528569 network_id = resource.ibm_pi_network.power_network.network_id
529- }
570+ }
530571 }
531572 ` , acc .Pi_cloud_instance_id , name , sapProfile , acc .Pi_sap_image )
532573}
@@ -703,7 +744,7 @@ func testAccCheckIBMPIStoppedInstanceConfigUpdate(name, instanceHealthStatus, pr
703744 pi_volume_pool = data.ibm_pi_image.power_image.storage_pool
704745 pi_volume_shareable = true
705746 pi_volume_size = 20
706- }
747+ }
707748 resource "ibm_pi_instance" "power_instance" {
708749 pi_cloud_instance_id = "%[1]s"
709750 pi_health_status = "%[5]s"
0 commit comments