Skip to content

Commit 24f1a88

Browse files
Diptipowervsmichaelkad
authored andcommitted
Update storage connection.
update to 1.8.1
1 parent 2aa2176 commit 24f1a88

11 files changed

+79
-21
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.22.5
77
require (
88
github.com/IBM-Cloud/bluemix-go v0.0.0-20240719075425-078fcb3a55be
99
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113
10-
github.com/IBM-Cloud/power-go-client v1.7.0
10+
github.com/IBM-Cloud/power-go-client v1.8.1
1111
github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca
1212
github.com/IBM/appconfiguration-go-admin-sdk v0.3.0
1313
github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f

go.sum

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ github.com/IBM-Cloud/bluemix-go v0.0.0-20240719075425-078fcb3a55be/go.mod h1:/7h
118118
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113 h1:f2Erqfea1dKpaTFagTJM6W/wnD3JGq/Vn9URh8nuRwk=
119119
github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240725064144-454a2ae23113/go.mod h1:xUQL9SGAjoZFd4GNjrjjtEpjpkgU7RFXRyHesbKTjiY=
120120
github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.5.3/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs=
121-
github.com/IBM-Cloud/power-go-client v1.7.0 h1:/GuGwPMTKoCZACfnwt7b6wKr4v32q1VO1AMFGNETRN4=
122-
github.com/IBM-Cloud/power-go-client v1.7.0/go.mod h1:9izycYAmNQ+NAdVPXDC3fHYxqWLjlR2YiwqKYveMv5Y=
121+
github.com/IBM-Cloud/power-go-client v1.8.1 h1:tx1aPJmIQrNru1MD1VHGNasGx3eRIs0zzPZ0KvdFQrg=
122+
github.com/IBM-Cloud/power-go-client v1.8.1/go.mod h1:N4RxrsMUvBQjSQ/qPk0iMZ8zK+fZPRTnHi/gTaASw0g=
123123
github.com/IBM-Cloud/softlayer-go v1.0.5-tf h1:koUAyF9b6X78lLLruGYPSOmrfY2YcGYKOj/Ug9nbKNw=
124124
github.com/IBM-Cloud/softlayer-go v1.0.5-tf/go.mod h1:6HepcfAXROz0Rf63krk5hPZyHT6qyx2MNvYyHof7ik4=
125125
github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca h1:crniVcf+YcmgF03NmmfonXwSQ73oJF+IohFYBwknMxs=
@@ -138,8 +138,6 @@ github.com/IBM/container-registry-go-sdk v1.1.0 h1:sYyknIod8R4RJZQqAheiduP6wbSTp
138138
github.com/IBM/container-registry-go-sdk v1.1.0/go.mod h1:4TwsCnQtVfZ4Vkapy/KPvQBKFc3VOyUZYkwRU4FTPrs=
139139
github.com/IBM/continuous-delivery-go-sdk v1.6.0 h1:eAL/jIWHrDFlWDF+Qd9Y5UN99Pr5Mjd/H/bvTbXUbz4=
140140
github.com/IBM/continuous-delivery-go-sdk v1.6.0/go.mod h1:nZdKUnubXNLo+zo28R4Rd+TGDqiJ/xoE8WO/A3kLw1E=
141-
github.com/IBM/event-notifications-go-admin-sdk v0.8.0 h1:xk2CYTayQtKi6LSgGGFRxFJfWUxyM5SY8Rs64ducAhw=
142-
github.com/IBM/event-notifications-go-admin-sdk v0.8.0/go.mod h1:OByvqfrNVxs7G6ggv8pwQCEVw10/TBJCLh7NM3z707w=
143141
github.com/IBM/event-notifications-go-admin-sdk v0.9.0 h1:eaCd+GkxhNyot+8rA9WkAQdlVYrRD20LYiXjEytFO6M=
144142
github.com/IBM/event-notifications-go-admin-sdk v0.9.0/go.mod h1:OByvqfrNVxs7G6ggv8pwQCEVw10/TBJCLh7NM3z707w=
145143
github.com/IBM/eventstreams-go-sdk v1.4.0 h1:yS/Ns29sBOe8W2tynQmz9HTKqQZ0ckse4Py5Oy/F2rM=
@@ -187,8 +185,6 @@ github.com/IBM/scc-go-sdk/v5 v5.4.1 h1:RXIuxOo9/hxkWyHCI69ae+KIJgSbXcAkJwTEl+fO3
187185
github.com/IBM/scc-go-sdk/v5 v5.4.1/go.mod h1:2xQTDgNXG5QMEfQxBDKB067z+5ha6OgcaKCTcdGDAo8=
188186
github.com/IBM/schematics-go-sdk v0.2.3 h1:lgTt0Sbudii3cuSk1YSQgrtiZAXDbBABAoVj3eQuBrU=
189187
github.com/IBM/schematics-go-sdk v0.2.3/go.mod h1:Tw2OSAPdpC69AxcwoyqcYYaGTTW6YpERF9uNEU+BFRQ=
190-
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.5 h1:VMc/Zd6RzB8j60CqZekkwYT2wQsCfrkGV2n01Gviuaw=
191-
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.5/go.mod h1:5kUgJ1dG9cdiAcPDqVz46m362bPnoqZQSth24NiowSg=
192188
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.6 h1:bF6bAdI4wDZSje6+Yx1mJxvirboxO+uMuKhzgfRCNxE=
193189
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.6/go.mod h1:XWYnbcc5vN1RnKwk/fCzfD8aZd7At/Y1/b6c+oDyliU=
194190
github.com/IBM/vmware-go-sdk v0.1.2 h1:5lKWFyInWz9e2hwGsoFTEoLa1jYkD30SReN0fQ10w9M=

ibm/acctest/acctest.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ var (
224224
Pi_shared_processor_pool_id string
225225
Pi_snapshot_id string
226226
Pi_spp_placement_group_id string
227+
Pi_storage_connection string
227228
Pi_target_storage_tier string
228229
Pi_volume_clone_task_id string
229230
Pi_volume_group_id string
@@ -1190,7 +1191,10 @@ func init() {
11901191
Pi_shared_processor_pool_id = "tf-pi-shared-processor-pool"
11911192
fmt.Println("[WARN] Set the environment variable PI_SHARED_PROCESSOR_POOL_ID for testing ibm_pi_shared_processor_pool resource else it is set to default value 'tf-pi-shared-processor-pool'")
11921193
}
1193-
1194+
Pi_storage_connection = os.Getenv("PI_STORAGE_CONNECTION")
1195+
if Pi_storage_connection == "" {
1196+
fmt.Println("[WARN] Set the environment variable PI_STORAGE_CONNECTION for testing pi_storage_connection resource else it is empty")
1197+
}
11941198
Pi_target_storage_tier = os.Getenv("PI_TARGET_STORAGE_TIER")
11951199
if Pi_target_storage_tier == "" {
11961200
Pi_target_storage_tier = "terraform-test-tier"

ibm/service/power/data_source_ibm_pi_instance.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ func DataSourceIBMPIInstance() *schema.Resource {
193193
Description: "The status of the instance.",
194194
Type: schema.TypeString,
195195
},
196+
Attr_StorageConnection: {
197+
Computed: true,
198+
Description: "The storage connection type.",
199+
Type: schema.TypeString,
200+
},
196201
Attr_StoragePool: {
197202
Computed: true,
198203
Description: "The storage Pool where server is deployed.",
@@ -256,6 +261,7 @@ func dataSourceIBMPIInstancesRead(ctx context.Context, d *schema.ResourceData, m
256261
d.Set(Attr_SharedProcessorPool, powervmdata.SharedProcessorPool)
257262
d.Set(Attr_SharedProcessorPoolID, powervmdata.SharedProcessorPoolID)
258263
d.Set(Attr_Status, powervmdata.Status)
264+
d.Set(Attr_StorageConnection, powervmdata.StorageConnection)
259265
d.Set(Attr_StorageType, powervmdata.StorageType)
260266
d.Set(Attr_StoragePool, powervmdata.StoragePool)
261267
d.Set(Attr_StoragePoolAffinity, powervmdata.StoragePoolAffinity)

ibm/service/power/data_source_ibm_pi_instances.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ func DataSourceIBMPIInstances() *schema.Resource {
174174
Description: "The status of the instance.",
175175
Type: schema.TypeString,
176176
},
177+
Attr_StorageConnection: {
178+
Computed: true,
179+
Description: "The storage connection type.",
180+
Type: schema.TypeString,
181+
},
177182
Attr_StoragePool: {
178183
Computed: true,
179184
Description: "The storage Pool where server is deployed.",
@@ -247,6 +252,7 @@ func flattenPvmInstances(list []*models.PVMInstanceReference) []map[string]inter
247252
Attr_SharedProcessorPool: i.SharedProcessorPool,
248253
Attr_SharedProcessorPoolID: i.SharedProcessorPoolID,
249254
Attr_Status: *i.Status,
255+
Attr_StorageConnection: i.StorageConnection,
250256
Attr_StoragePool: i.StoragePool,
251257
Attr_StoragePoolAffinity: i.StoragePoolAffinity,
252258
Attr_StorageType: i.StorageType,

ibm/service/power/ibm_pi_constants.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const (
3535
Arg_ImageID = "pi_image_id"
3636
Arg_ImageImportDetails = "pi_image_import_details"
3737
Arg_ImageName = "pi_image_name"
38+
Arg_ImportDetails = "pi_image_import_details"
3839
Arg_InstanceID = "pi_instance_id"
3940
Arg_InstanceName = "pi_instance_name"
4041
Arg_Key = "pi_ssh_key"
@@ -339,6 +340,7 @@ const (
339340
Attr_Status = "status"
340341
Attr_StatusDescriptionErrors = "status_description_errors"
341342
Attr_StatusDetail = "status_detail"
343+
Attr_StorageConnection = "storage_connection"
342344
Attr_StoragePool = "storage_pool"
343345
Attr_StoragePoolAffinity = "storage_pool_affinity"
344346
Attr_StoragePoolsCapacity = "storage_pools_capacity"
@@ -431,6 +433,7 @@ const (
431433
Hard = "hard"
432434
Host = "host"
433435
HostGroup = "hostGroup"
436+
MaxVolumeSupport = "maxVolumeSupport"
434437
Netweaver = "Netweaver"
435438
None = "none"
436439
OK = "OK"

ibm/service/power/resource_ibm_pi_instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func ResourceIBMPIInstance() *schema.Resource {
285285
Description: "Storage Connectivity Group for server deployment",
286286
Optional: true,
287287
Type: schema.TypeString,
288-
ValidateFunc: validate.ValidateAllowedStringValues([]string{vSCSI}),
288+
ValidateFunc: validate.ValidateAllowedStringValues([]string{vSCSI, MaxVolumeSupport}),
289289
},
290290
Arg_SysType: {
291291
Computed: true,

ibm/service/power/resource_ibm_pi_instance_test.go

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
}
259281
func 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+
}
339380
func 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"

website/docs/d/pi_instance.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ In addition to all argument reference list, you can access the following attribu
9191
- `shared_processor_pool`- (String) The name of the shared processor pool for the instance.
9292
- `shared_processor_pool_id` - (String) The ID of the shared processor pool for the instance.
9393
- `status` - (String) The status of the instance.
94+
- `storage_connection` - (String) The storage connection type for the instance.
9495
- `storage_pool` - (String) The storage Pool where server is deployed.
9596
- `storage_pool_affinity` - (Boolean) Indicates if all volumes attached to the server must reside in the same storage pool.
9697
- `storage_type` - (String) The storage type where server is deployed.

website/docs/d/pi_instances.html.markdown

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ In addition to all argument reference list, you can access the following attribu
6767
- `networks` - (List) List of networks associated with this instance.
6868

6969
Nested scheme for `networks`:
70-
- `external_ip` - (String) The external IP address of the instance.
71-
- `ip` - (String) The IP address of the instance.
72-
- `macaddress` - (String) The MAC address of the instance. Deprecated please use `mac_address` instead.
70+
- `external_ip` - (String) The external IP address of the instance.
71+
- `ip` - (String) The IP address of the instance.
72+
- `macaddress` - (String) The MAC address of the instance. Deprecated please use `mac_address` instead.
7373
- `mac_address` - (String) The MAC address of the instance.
74-
- `network_id` - (String) The network ID of the instance.
75-
- `network_name` - (String) The network name of the instance.
76-
- `type` - (String) The type of the network.
74+
- `network_id` - (String) The network ID of the instance.
75+
- `network_name` - (String) The network name of the instance.
76+
- `type` - (String) The type of the network.
7777

7878
- `pin_policy` - (String) The pinning policy of the instance.
7979
- `placement_group_id`- (String) The ID of the placement group that the instance is a member.
@@ -84,6 +84,7 @@ In addition to all argument reference list, you can access the following attribu
8484
- `shared_processor_pool`- (String) The name of the shared processor pool for the instance.
8585
- `shared_processor_pool_id` - (String) The ID of the shared processor pool for the instance.
8686
- `status` - (String) The status of the instance.
87+
- `storage_connection` - (String) The storage connection type for the instance
8788
- `storage_pool` - (String) The storage Pool where server is deployed.
8889
- `storage_pool_affinity` - (Boolean) Indicates if all volumes attached to the server must reside in the same storage pool.
8990
- `storage_type` - (String) The storage type where server is deployed.

0 commit comments

Comments
 (0)