powerflex_sdc_volumes_mapping (Resource)

This resource can be used to manage mapping of volumes to an SDC on a PowerFlex array.

Caution: SDC Volume mapping creation or update is not atomic. In case of partially completed create operations, terraform can mark the resource as tainted. One can manually remove the taint and try applying the configuration (after making necessary adjustments). If the taint is not removed, terraform will destroy and recreate the resource.

Note: Exactly one of id and name is required. Exactly one of volume_id and volume_name is required.

Example Usage

/*
Copyright (c) 2023 Dell Inc., or its subsidiaries. All Rights Reserved.

Licensed under the Mozilla Public License Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://mozilla.org/MPL/2.0/


Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

# Command to run this tf file : terraform init && terraform plan && terraform apply.
# Create, Update, Delete is supported for this resource.
# To import, check import.sh for more info.
# To create/update, either SDC ID or SDC name must be provided.
# volume_list attribute is optional. 
# To check which attributes of the sdc_volumes_mappping resource can be updated, please refer Product Guide in the documentation

resource "powerflex_sdc_volumes_mapping" "mapping-test" {
  id = "e3ce1fb600000001"
  volume_list = [
    {
      volume_id        = "edb2059700000002"
      limit_iops       = 140
      limit_bw_in_mbps = 19
      access_mode      = "ReadOnly"
    },
    {
      volume_name      = "terraform-vol"
      access_mode      = "ReadWrite"
      limit_iops       = 120
      limit_bw_in_mbps = 25
    }
  ]
}

# To unmap all the volumes mapped to SDC, below config can be used. 

resource "powerflex_sdc_volumes_mapping" "mapping-test" {
  id          = "e3ce1fb600000001"
  volume_list = []
}

Schema

Optional

  • id (String) The ID of the SDC.
  • name (String) The name of the SDC.
  • volume_list (Attributes Set) List of volumes mapped to SDC. At least one of volume_id and volume_name is required. (see below for nested schema)

Nested Schema for volume_list

Optional:

  • access_mode (String) The Access Mode of the SDC. Valid values are ReadOnly, ReadWrite and NoAccess. Default value is ReadOnly.
  • limit_bw_in_mbps (Number) Bandwidth limit in MBPS. 0 represents unlimited bandwith. Default value is 0.
  • limit_iops (Number) IOPS limit. Valid values are 0 or integers greater than 10. 0 represents unlimited IOPS. Default value is 0.
  • volume_id (String) The ID of the volume.
  • volume_name (String) The name of the volume.

Import

Import is supported using the following syntax:

# Below are the steps to import sdc along with mapped volumes :
# Step 1 - To import a sdc , we need the id of that sdc
# Step 2 - To check the id of the sdc we can make use of sdc datasource . Please refer sdc_datasource.tf for more info.
# Step 3 - create a tf file with empty resource block . Refer the example below.
# Example :
# resource "powerflex_sdc_volumes_mapping" "resource_block_name" {
# }
# Step 4 - execute the command: terraform import "powerflex_sdc_volumes_mapping.resource_block_name" "id_of_the_sdc" (resource_block_name must be taken from step 3 and id must be taken from step 2)
# Step 5 - After successful execution of the command , check the state file.