powerstore_volume (Resource)

Volume Resource.

Example Usage

# Commands to run this tf file : terraform init && terraform plan && terraform apply
# Create, Update, Delete is supported for this resource
# To import , check volume_import.tf for more info
# name and size are the required attributes to create and update
# To check which attributes of the volume can be updated, please refer Product Guide in the documentation


resource "powerstore_volume" "test1" {
  name                  = "test_vol1"
  size                  = 3
  capacity_unit         = "GB"
  description           = "Creating volume"
  host_id               = ""
  host_group_id         = ""
  appliance_id          = "A1"
  volume_group_id       = ""
  min_size              = 1048576
  sector_size           = 512
  protection_policy_id  = ""
  performance_policy_id = "default_medium"
  app_type              = "Relational_Databases_Other"
  app_type_other        = ""
}

Schema

Required

  • name (String) The name of the volume.
  • size (Number) The size of the volume.

Optional

  • app_type (String) The app type of the volume.
  • app_type_other (String) The app type other of the volume.
  • appliance_id (String) The appliance_id of the volume.
  • appliance_name (String) The appliance name of the volume.
  • capacity_unit (String) The Capacity Unit corresponding to the size.
  • description (String) The description of the volume.
  • host_group_id (String) The host group id of the volume.
  • host_group_name (String) The host group name of the volume.
  • host_id (String) The host id of the volume.
  • host_name (String) The host name of the volume.
  • logical_unit_number (Number) The current amount of data written to the volume.
  • min_size (Number) The minimum size of the volume.
  • performance_policy_id (String) The performance_policy_id of the volume.
  • protection_policy_id (String) The protection_policy_id of the volume.
  • protection_policy_name (String) The protection policy name of the volume.
  • sector_size (Number) The sector size of the volume.
  • volume_group_id (String) The volume group id of the volume.
  • volume_group_name (String) The volume group name of the volume.

Read-Only

  • creation_timestamp (String) The creation_timestamp of the volume.
  • id (String) The ID of the volume.
  • is_replication_destination (Boolean) The is_replication_destination of the volume.
  • logical_used (Number) Current amount of data used by the volume.
  • nguid (String) The nguid of the volume.
  • node_affinity (String) The node_affinity of the volume.
  • nsid (Number) The nsid of the volume.
  • state (String) The state of the volume.
  • type (String) The type of the volume.
  • wwn (String) The wwn of the volume.

Import

Import is supported using the following syntax:

# Below are the steps to import volume :
# Step 1 - To import a volume , we need the id of that volume 
# Step 2 - To check the id of the volume we can make Get request to volume endpoint. eg. https://10.0.0.1/api/rest/volume which will return list of all volume ids.
# Step 3 - Add empty resource block in tf file. 
# eg. 
# resource "powerstore_volume" "resource_block_name" {
  # (resource arguments)
# }
# Step 4 - Execute the command: terraform import "powerstore_volume.resource_block_name" "id_of_the_volume" (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