powerstore_volumegroup (Resource)

VolumeGroup resource

Note: Exactly one of volume_ids and volume_names is required.
Note: Exactly one of protection_policy_id and protection_policy_name is required.

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_group_import.tf for more info
# name is the required attribute to create and update
# Volume datasource can be used to fetch volume id/name.
# Protection policy datasource can be used to fetch protection policy id/name.
# To check which attributes of the volume group can be updated, please refer Product Guide in the documentation

resource "powerstore_volumegroup" "terraform-provider-test1" {
  # (resource arguments)
  description               = "Creating Volume Group"
  name                      = "test_volume_group"
  is_write_order_consistent = "false"
  protection_policy_id      = "01b8521d-26f5-479f-ac7d-3d8666097094"
  volume_ids                = ["140bb395-1d85-49ae-bde8-35070383bd92"]
}

Schema

Required

  • name (String) Name of the volume group.

Optional

  • description (String) Description for the volume group.
  • is_write_order_consistent (Boolean) Determines whether snapshot sets of the group will be write order consistent.
  • protection_policy_id (String) Unique identifier of the protection policy assigned to the volume group. Conflicts with protection_policy_name.
  • protection_policy_name (String) Unique name of the protection policy assigned to the volume group. Conflicts with protection_policy_id.
  • volume_ids (Set of String) A list of identifiers of existing volumes that should be added to the volume group. Conflicts with volume_names.
  • volume_names (Set of String) A list of names of existing volumes that should be added to the volume group. Conflicts with volume_ids.

Read-Only

  • id (String) Unique identifier of the volume group.

Import

Import is supported using the following syntax:

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