diff --git a/ibm/service/power/resource_ibm_pi_volume.go b/ibm/service/power/resource_ibm_pi_volume.go index 8feb10b8c7..67e207e289 100644 --- a/ibm/service/power/resource_ibm_pi_volume.go +++ b/ibm/service/power/resource_ibm_pi_volume.go @@ -109,12 +109,6 @@ func ResourceIBMPIVolume() *schema.Resource { Description: "List of pvmInstances to base volume anti-affinity policy against; required if requesting anti-affinity and pi_anti_affinity_volumes is not provided", ConflictsWith: []string{PIAntiAffinityVolumes}, }, - helpers.PIReplicationEnabled: { - Type: schema.TypeBool, - Optional: true, - Computed: true, - Description: "Indicates if the volume should be replication enabled or not", - }, // Computed Attributes "volume_id": { @@ -138,51 +132,6 @@ func ResourceIBMPIVolume() *schema.Resource { Computed: true, Description: "WWN Of the volume", }, - "auxiliary": { - Type: schema.TypeBool, - Computed: true, - Description: "true if volume is auxiliary otherwise false", - }, - "consistency_group_name": { - Type: schema.TypeString, - Computed: true, - Description: "Consistency Group Name if volume is a part of volume group", - }, - "group_id": { - Type: schema.TypeString, - Computed: true, - Description: "Volume Group ID", - }, - "replication_type": { - Type: schema.TypeString, - Computed: true, - Description: "Replication type(metro,global)", - }, - "replication_status": { - Type: schema.TypeString, - Computed: true, - Description: "Replication status of a volume", - }, - "mirroring_state": { - Type: schema.TypeString, - Computed: true, - Description: "Mirroring state for replication enabled volume", - }, - "primary_role": { - Type: schema.TypeString, - Computed: true, - Description: "Indicates whether master/aux volume is playing the primary role", - }, - "aux_volume_name": { - Type: schema.TypeString, - Computed: true, - Description: "Indicates auxiliary volume name", - }, - "master_volume_name": { - Type: schema.TypeString, - Computed: true, - Description: "Indicates master volume name", - }, }, } } @@ -229,10 +178,6 @@ func resourceIBMPIVolumeCreate(ctx context.Context, d *schema.ResourceData, meta volumePool := v.(string) body.VolumePool = volumePool } - if v, ok := d.GetOk(helpers.PIReplicationEnabled); ok { - replicationEnabled := v.(bool) - body.ReplicationEnabled = &replicationEnabled - } if ap, ok := d.GetOk(PIAffinityPolicy); ok { policy := ap.(string) body.AffinityPolicy = &policy @@ -304,16 +249,6 @@ func resourceIBMPIVolumeRead(ctx context.Context, d *schema.ResourceData, meta i if vol.VolumeID != nil { d.Set("volume_id", vol.VolumeID) } - d.Set(helpers.PIReplicationEnabled, vol.ReplicationEnabled) - d.Set("auxiliary", vol.Auxiliary) - d.Set("consistency_group_name", vol.ConsistencyGroupName) - d.Set("group_id", vol.GroupID) - d.Set("replication_type", vol.ReplicationType) - d.Set("replication_status", vol.ReplicationStatus) - d.Set("mirroring_state", vol.MirroringState) - d.Set("primary_role", vol.PrimaryRole) - d.Set("master_volume_name", vol.MasterVolumeName) - d.Set("aux_volume_name", vol.AuxVolumeName) if vol.DeleteOnTermination != nil { d.Set("delete_on_termination", vol.DeleteOnTermination) } @@ -356,22 +291,6 @@ func resourceIBMPIVolumeUpdate(ctx context.Context, d *schema.ResourceData, meta return diag.FromErr(err) } - if d.HasChange(helpers.PIReplicationEnabled) { - replicationEnabled := d.Get(helpers.PIReplicationEnabled).(bool) - volActionBody := models.VolumeAction{ - ReplicationEnabled: &replicationEnabled, - } - - err = client.VolumeAction(volumeID, &volActionBody) - if err != nil { - return diag.FromErr(err) - } - _, err = isWaitForIBMPIVolumeAvailable(ctx, client, volumeID, d.Timeout(schema.TimeoutUpdate)) - if err != nil { - return diag.FromErr(err) - } - } - return resourceIBMPIVolumeRead(ctx, d, meta) } diff --git a/ibm/service/power/resource_ibm_pi_volume_test.go b/ibm/service/power/resource_ibm_pi_volume_test.go index 8e5882c1ac..73c17360fb 100644 --- a/ibm/service/power/resource_ibm_pi_volume_test.go +++ b/ibm/service/power/resource_ibm_pi_volume_test.go @@ -160,60 +160,3 @@ func testAccCheckIBMPIVolumePoolConfig(name string) string { } `, name, acc.Pi_cloud_instance_id) } - -//TestAccIBMPIVolumeGRS test the volume replication feature which is part of global replication service(GRS) -func TestAccIBMPIVolumeGRS(t *testing.T) { - name := fmt.Sprintf("tf-pi-volume-%d", acctest.RandIntRange(10, 100)) - resource.Test(t, resource.TestCase{ - PreCheck: func() { acc.TestAccPreCheck(t) }, - Providers: acc.TestAccProviders, - CheckDestroy: testAccCheckIBMPIVolumeDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCheckIBMPIVolumeGRSConfig(name), - Check: resource.ComposeTestCheckFunc( - testAccCheckIBMPIVolumeExists("ibm_pi_volume.power_volume"), - resource.TestCheckResourceAttr( - "ibm_pi_volume.power_volume", "pi_volume_name", name), - resource.TestCheckResourceAttr( - "ibm_pi_volume.power_volume", "pi_replication_enabled", "true"), - resource.TestCheckResourceAttr( - "ibm_pi_volume.power_volume", "replication_type", "global"), - ), - }, - { - Config: testAccCheckIBMPIVolumeGRSUpdateConfig(name), - Check: resource.ComposeTestCheckFunc( - testAccCheckIBMPIVolumeExists("ibm_pi_volume.power_volume"), - resource.TestCheckResourceAttr( - "ibm_pi_volume.power_volume", "pi_volume_name", name), - resource.TestCheckResourceAttr( - "ibm_pi_volume.power_volume", "pi_replication_enabled", "false"), - resource.TestCheckResourceAttr( - "ibm_pi_volume.power_volume", "replication_type", ""), - ), - }, - }, - }) -} - -func testAccCheckIBMPIVolumeGRSConfig(name string) string { - return testAccCheckIBMPIVolumeGRSBasicConfig(name, acc.Pi_cloud_instance_id, acc.PiStoragePool, true) -} - -func testAccCheckIBMPIVolumeGRSUpdateConfig(name string) string { - return testAccCheckIBMPIVolumeGRSBasicConfig(name, acc.Pi_cloud_instance_id, acc.PiStoragePool, false) -} - -func testAccCheckIBMPIVolumeGRSBasicConfig(name, piCloudInstanceId, piStoragePool string, replicationEnabled bool) string { - return fmt.Sprintf(` - resource "ibm_pi_volume" "power_volume"{ - pi_volume_size = 20 - pi_volume_name = "%[1]s" - pi_volume_pool = "%[3]s" - pi_volume_shareable = true - pi_cloud_instance_id = "%[2]s" - pi_replication_enabled = %[4]v - } - `, name, piCloudInstanceId, piStoragePool, replicationEnabled) -} diff --git a/website/docs/r/pi_volume.html.markdown b/website/docs/r/pi_volume.html.markdown index f1a703f843..160ed1b8b7 100644 --- a/website/docs/r/pi_volume.html.markdown +++ b/website/docs/r/pi_volume.html.markdown @@ -55,7 +55,6 @@ Review the argument references that you can specify for your resource. - `pi_anti_affinity_instances` - (Optional, String) List of pvmInstances to base volume anti-affinity policy against; required if requesting `anti-affinity` and `pi_anti_affinity_volumes` is not provided. - `pi_anti_affinity_volumes`- (Optional, String) List of volumes to base volume anti-affinity policy against; required if requesting `anti-affinity` and `pi_anti_affinity_instances` is not provided. - `pi_cloud_instance_id` - (Required, String) The GUID of the service instance associated with an account. -- `pi_replication_enabled` - (Opttional, Bool) Indicates if the volume should be replication enabled or not. - `pi_volume_name` - (Required, String) The name of the volume. - `pi_volume_pool` - (Optional, String) Volume pool where the volume will be created; if provided then `pi_volume_type` and `pi_affinity_policy` values will be ignored. - `pi_volume_shareable` - (Required, Bool) If set to **true**, the volume can be shared across Power Systems Virtual Server instances. If set to **false**, you can attach it only to one instance. @@ -65,17 +64,8 @@ Review the argument references that you can specify for your resource. ## Attribute reference In addition to all argument reference list, you can access the following attribute reference after your resource is created. -- `auxiliary` - (Bool) Indicates if the volume is auxiliary or not. -- `aux_volume_name` - (String) The auxiliary volume name. -- `consistency_group_name` - (String) The consistency group name if volume is a part of volume group. - `delete_on_termination` - (Bool) Indicates if the volume should be deleted when the server terminates. -- `group_id` - (String) The volume group id in which the volume belongs. - `id` - (String) The unique identifier of the volume. The ID is composed of `/`. -- `master_volume_name` - (String) The master volume name. -- `mirroring_state` - (String) The mirroring state for replication enabled volume. -- `primary_role` - (String) Indicates whether `master`/`auxiliary` volume is playing the primary role. -- `replication_status` - (String) The replication status of the volume. -- `replication_type` - (String) The replication type of the volume `metro` or `global`. - `volume_id` - (String) The unique identifier of the volume. - `volume_status` - (String) The status of the volume. - `wwn` - (String) The world wide name of the volume.