powerflex_device (Resource)

This resource can be used to manage devices on a PowerFlex array.

Caution: Device 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 storage_pool_name and storage_pool_id is required. Exactly one of sds_name and sds_id 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, Read, Delete and Import operations are supported for this resource.
# To add device, device_path is mandatory along with storage_pool_name/storage_pool_id and sds_name/sds_id.
# Along with storage_pool_name, we have to specify protection_domain_id or protection_domain_name.
# To check which attributes of the device resource can be updated, please refer Product Guide in the documentation

resource "powerflex_device" "test-device" {
  device_path            = "/dev/sdc"
  storage_pool_name      = "pool1"
  protection_domain_name = "domain1"
  sds_name               = "SDS_2"
  media_type             = "HDD"
}

Schema

Required

  • device_path (String) The current path of the device. Cannot be updated.

Optional

  • device_capacity (Number) Capacity of the device in GB.
  • external_acceleration_type (String) External acceleration type of the device. Valid values are None, Read, Write, ReadAndWrite.
  • media_type (String) Media type of the device. Valid values are HDD, SSD.
  • name (String) The name of the device.
  • protection_domain_id (String) ID of the protection domain. Conflicts with protection_domain_name. Cannot be updated.
  • protection_domain_name (String) Name of the protection domain. Conflicts with protection_domain_id. Cannot be updated.
  • sds_id (String) ID of the SDS. Conflicts with sds_name. Cannot be updated.
  • sds_name (String) Name of the SDS. Conflicts with sds_id. Cannot be updated.
  • storage_pool_id (String) ID of the storage pool. Conflicts with storage_pool_name. Cannot be updated.
  • storage_pool_name (String) Name of the storage pool. Conflicts with storage_pool_id. Cannot be updated.

Read-Only

  • device_capacity_in_kb (Number) Capacity of the device in KB.
  • device_original_path (String) Original path of the device.
  • device_state (String) State of the device.
  • id (String) The ID of the device.

Import

Import is supported using the following syntax:

# Below are the steps to import device :
# Step 1 - To import a device , we need the id of that device
# Step 2 - To check the id of the device we can make use of device datasource . Please refer device_datasource.tf for more info.
# Step 3 - create a tf file with empty resource block . Refer the example below.
# Example :
# resource "powerflex_device" "resource_block_name" {
# }
# Step 4 - execute the command: terraform import "powerflex_device.resource_block_name" "id_of_the_device" (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