Skip to content

qumulo_snapshot_policy (Resource)

Manages a snapshot policy on a Qumulo cluster.

Snapshot policies automate the creation of point-in-time snapshots on a schedule. You can configure daily, weekly, monthly, or more frequent snapshots with automatic expiration.

Example Usage

Installation

terraform {
  required_providers {
    qumulo = {
      source  = "qumulo-terraform-registry.s3.us-east-1.amazonaws.com/qumulo/qumulo"
      version = "~> 1.0"
    }
  }
}

Daily Snapshots (using source_path)

resource "qumulo_snapshot_policy" "daily" {
  connection_profile = "prod"

  policy_name = "daily-backup"
  source_path = "/data"  # Automatically resolved to file ID

  schedule {
    timezone                = "America/Los_Angeles"
    frequency               = "SCHEDULE_DAILY_OR_WEEKLY"
    hour                    = 2
    minute                  = 0
    on_days                 = ["EVERY_DAY"]
    expiration_time_to_live = "7days"
  }
}

Hourly During Business Hours

resource "qumulo_snapshot_policy" "hourly" {
  connection_profile = "prod"

  policy_name = "business-hours"
  source_path = "/projects"

  schedule {
    timezone                = "UTC"
    frequency               = "SCHEDULE_HOURLY_OR_LESS"
    on_days                 = ["MON", "TUE", "WED", "THU", "FRI"]
    window_start_hour       = 9
    window_start_minute     = 0
    window_end_hour         = 17
    window_end_minute       = 0
    fire_every_interval     = "FIRE_IN_HOURS"
    fire_every              = 1
    expiration_time_to_live = "24hours"
  }
}

Monthly Archive

resource "qumulo_snapshot_policy" "monthly" {
  connection_profile = "prod"

  policy_name    = "monthly-archive"
  source_file_id = "2"  # Direct file ID if known

  schedule {
    timezone                = "UTC"
    frequency               = "SCHEDULE_MONTHLY"
    day_of_month            = 1
    hour                    = 0
    minute                  = 0
    expiration_time_to_live = "never"
  }
}

Multi-Cluster with for_each

variable "clusters" {
  type = set(string)
  default = ["prod", "dr"]
}

resource "qumulo_snapshot_policy" "backup" {
  for_each = var.clusters

  connection_profile = each.value

  policy_name = "standard-backup"
  source_path = "/data"

  schedule {
    timezone                = "UTC"
    frequency               = "SCHEDULE_DAILY_OR_WEEKLY"
    hour                    = 3
    minute                  = 0
    on_days                 = ["EVERY_DAY"]
    expiration_time_to_live = "14days"
  }
}

Schema

Required

  • connection_profile (String) Name of a connection profile defined in the provider block.

Connection profiles centralize cluster credentials at the provider level. Define profiles in the provider block:

provider "qumulo" {
  connection_profiles = [
    {
      name                 = "prod"
      endpoint             = "https://cluster.example.com:8000"
      username             = "admin"
      password             = var.cluster_password
      insecure_skip_verify = true  # For self-signed certificates
    }
  ]
}
- policy_name (String) The name of the snapshot policy.

Optional

  • enabled (Boolean) Whether the policy is enabled. Defaults to true.
  • schedule (Block, Optional) The schedule configuration for when snapshots are taken. (see below for nested schema)
  • snapshot_name_template (String) The naming template for snapshots. Uses placeholders like {ID}, {Policy}, {Directory}. Defaults to {ID}{Policy} for root or {ID} for subdirectories.}_{Directory
  • source_file_id (String) The file ID of the directory to snapshot. Computed if source_path is provided. Use either source_path or source_file_id, not both. Changing this value will replace the policy.
  • source_path (String) The filesystem path to snapshot. This is resolved to a file ID automatically. Use either source_path or source_file_id, not both. Changing this value will replace the policy.

Read-Only

  • id (String) The unique ID of the snapshot policy.
  • schedule_id (Number) The schedule ID associated with this policy.

Nested Schema for schedule

Required:

  • frequency (String) The frequency type: SCHEDULE_MONTHLY, SCHEDULE_DAILY_OR_WEEKLY, or SCHEDULE_HOURLY_OR_LESS.
  • timezone (String) The timezone for the schedule (e.g., 'UTC', 'America/Los_Angeles'). Uses standard IANA timezone names.

Optional:

  • day_of_month (Number) Day of month [1-27] to take snapshot, or 128 for last day of month. Required for SCHEDULE_MONTHLY.
  • expiration_time_to_live (String) Duration after which snapshots expire (e.g., '7days', '24hours', '2weeks'). Use 'never' or empty string for no expiration.
  • fire_every (Number) Interval value [1-99] for how often to take snapshots within the window. Required for SCHEDULE_HOURLY_OR_LESS.
  • fire_every_interval (String) Interval unit: FIRE_IN_MINUTES or FIRE_IN_HOURS. Required for SCHEDULE_HOURLY_OR_LESS.
  • hour (Number) Hour of day [0-23] to take snapshot. Required for SCHEDULE_MONTHLY and SCHEDULE_DAILY_OR_WEEKLY.
  • minute (Number) Minute of hour [0-59] to take snapshot. Required for SCHEDULE_MONTHLY and SCHEDULE_DAILY_OR_WEEKLY.
  • on_days (List of String) Days of the week: SUN, MON, TUE, WED, THU, FRI, SAT, or EVERY_DAY. Required for SCHEDULE_DAILY_OR_WEEKLY and SCHEDULE_HOURLY_OR_LESS.
  • window_end_hour (Number) End hour [0-23] of the snapshot window. Required for SCHEDULE_HOURLY_OR_LESS.
  • window_end_minute (Number) End minute [0-59] of the snapshot window. Required for SCHEDULE_HOURLY_OR_LESS.
  • window_start_hour (Number) Start hour [0-23] of the snapshot window. Required for SCHEDULE_HOURLY_OR_LESS.
  • window_start_minute (Number) Start minute [0-59] of the snapshot window. Required for SCHEDULE_HOURLY_OR_LESS.