Skip to content

Latest commit

 

History

History
125 lines (100 loc) · 5.92 KB

volumegroup_snapshot.md

File metadata and controls

125 lines (100 loc) · 5.92 KB
title linkTitle page_title subcategory description
powerstore_volumegroup_snapshot resource
powerstore_volumegroup_snapshot
powerstore_volumegroup_snapshot Resource - powerstore
This resource is used to manage the volumegroup snapshot entity of PowerStore Array. We can Create, Update and Delete the volumegroup snapshot using this resource. We can also import an existing host from volumegroup snapshot array.

powerstore_volumegroup_snapshot (Resource)

This resource is used to manage the volumegroup snapshot entity of PowerStore Array. We can Create, Update and Delete the volumegroup snapshot using this resource. We can also import an existing host from volumegroup snapshot array.

~> Note: volume_group_id/volume_group_name is the required attribute to create volume group snapshot.
~> Note: expiration_timestamp if present in config cannot be blank(""). if absent, default value is allocated to it.
~> Note: During create operation, if expiration_timestamp is not specified or set to blank(""), snapshot will be created with infinite retention.
~> Note: During modify operation, to set infinite retention, expiration_timestamp can be set to blank("").
~> Note: Volume group DataSource can be used to fetch volume group ID/Name.
~> Note: Exactly one of volume_group_id and volume_group_name should be provided.

Example Usage

/*
Copyright (c) 2024 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.
*/

# Commands to run this tf file : terraform init && terraform plan && terraform apply
# Create, Update, Delete is supported for this resource
# To import , check volumegroup_snapshot_import.tf for more info
# name and volume_group_id/volume_group_name are the required attributes to create volume group snapshot.
# description and expiration_timestamp are the optional attributes.
# Either volume_group_id or volume_group_name should be present.
# VolumeGroup DataSource can be used to fetch volume group ID/Name.
# During create operation, if expiration_timestamp is not specified or set to blank(""), snapshot will be created with infinite retention.
# During modify operation, to set infinite retention, expiration_timestamp can be set to blank("").
# To check which attributes of the volume group snapshot resource can be updated, please refer Product Guide in the documentation

resource "powerstore_volumegroup_snapshot" "test" {
  name                 = "test_snap"
  volume_group_id      = "075aeb23-c782-4cce-9372-5a2e31dc5138"
  expiration_timestamp = "2023-05-06T09:01:47Z"
}

After the execution of above resource block, volume group snapshot would have been created on the PowerStore array. For more information, Please check the terraform state file.

Schema

Required

  • name (String) Name of the volume group snapshot.

Optional

  • description (String) Description of the volume group snapshot.
  • expiration_timestamp (String) Expiration Timestamp of the volume group snapshot.Only UTC (+Z) format is allowed
  • volume_group_id (String) ID of the volume group to take snapshot. Conflicts with volume_group_name. Cannot be updated.
  • volume_group_name (String) Name of the volume group to take snapshot. Conflicts with volume_group_id. Cannot be updated.

Read-Only

  • id (String) The unique identifier of the volume group snapshot.

Import

Import is supported using the following syntax:

#Copyright (c) 2024 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.


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