powerscale_snapshot_restore (Resource)

This resource is used to restore the data from the snapshot of PowerScale Array. The restore is done using copy/clone/snaprevert job. We can Create, Update and Delete using this resource.

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.
*/

# Restore snapshot using snaprevert job. SnapRevert domain will be deleted once `terraform destroy` is executed.
resource "powerscale_snapshot_restore" "test" {
  snaprevert_params = {
    allow_dup   = true
    snapshot_id = "snapshot_id"
  }
}

# terraform destroy will delete the snaprevert domain if restore is done using snapshot revert.

# Restore snapshot using copy operation
resource "powerscale_snapshot_restore" "test" {
  copy_params = {
    directory = {
      source      = "Path of the snapshot to copy" # e.g. /namespace/ifs/.snapshot/snapshot_name/directory
      destination = "Path of the destination"      # '/' is not required at the start e.g. ifs/dest
      overwrite   = true
    }
  }
}

# Restore snapshot using clone operation
resource "powerscale_snapshot_restore" "test" {
  clone_params = {
    source      = "Path of the snapshot to copy" # e.g. /namespace/ifs/.snapshot/snapshot_name/directory/file
    destination = "Path of the destination"      # '/' is not required at the start e.g. ifs/dest/test.txt
    snapshot_id = "Snapshot ID"
  }
}

Schema

Optional

Read-Only

  • id (String) Placeholder ID

Nested Schema for clone_params

Required:

  • destination (String) Destination of the snapshot, e.g. ifs/dest/test.txt .
  • snapshot_id (Number) Snapshot ID.
  • source (String) Source of the snapshot.

Optional:

  • overwrite (Boolean) Whether or not to overwrite the destination if it already exists.

Nested Schema for copy_params

Optional:

Nested Schema for copy_params.directory

Required:

  • destination (String) Destination of the snapshot, e.g. ifs/dest.
  • source (String) Source of the snapshot.

Optional:

  • continue (Boolean) Whether or not to continue if the destination already exists.
  • merge (Boolean) Whether or not to merge the destination if it already exists.
  • overwrite (Boolean) Whether or not to overwrite the destination if it already exists.

Nested Schema for copy_params.file

Required:

  • destination (String) Destination of the snapshot, e.g. ifs/dest/test.txt .
  • source (String) Source of the snapshot.

Optional:

  • overwrite (Boolean) Whether or not to overwrite the destination if it already exists.

Nested Schema for snaprevert_params

Required:

  • snapshot_id (Number) Snapshot ID.

Optional:

  • allow_dup (Boolean) Whether or not to queue the job if one of the same type is already running or queued.

Read-Only:

  • job_id (Number) Job ID.

Unless specified otherwise, all fields of this resource can be updated.