Skip to content

Schedule snapshots

When you finish, the cluster snapshots /data every night at 2:00 and deletes each snapshot after seven days.

Before you start

  • A Qumulo cluster whose REST API on port 8000 you can reach from this machine
  • An admin account on the cluster for the connection profile
  • The directory to protect, already on the cluster
  • Terraform 1.11 or later

1. Copy the configuration

Save this as main.tf in an empty directory.

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

provider "qumulo" {
  connection_profiles = [
    {
      name                 = "cluster1"
      endpoint             = "https://cluster.example.com:8000" # <-- Replace with your cluster's REST API endpoint
      username             = "admin"
      password             = "YourClusterPassword123!" # <-- Replace with your admin password
      insecure_skip_verify = true
    },
  ]
}

resource "qumulo_snapshot_policy" "daily" {
  connection_profile = "cluster1"

  policy_name = "daily-backup"
  source_path = "/data" # <-- Replace with the directory to protect

  schedule {
    timezone                = "America/Los_Angeles" # <-- Replace with your IANA timezone
    frequency               = "SCHEDULE_DAILY_OR_WEEKLY"
    on_days                 = ["EVERY_DAY"]
    hour                    = 2
    minute                  = 0
    expiration_time_to_live = "7days"
  }
}

Replace the four values marked <-- Replace, and leave the rest as written. Delete insecure_skip_verify if the cluster's certificate is signed by a CA your machine trusts.

2. Choose the schedule

  • For weekly snapshots, set on_days to the days you want, such as ["SUN"].
  • For snapshots every hour or more often inside a daily window, set frequency = "SCHEDULE_HOURLY_OR_LESS", replace hour and minute with window_start_hour, window_start_minute, window_end_hour, and window_end_minute, and add fire_every_interval and fire_every.
  • For one snapshot a month, set frequency = "SCHEDULE_MONTHLY" and replace on_days with day_of_month.
  • To keep snapshots until you delete them, set expiration_time_to_live = "never".
  • To protect another directory, copy the qumulo_snapshot_policy block with a new resource name, policy_name, and source_path.

The plan in step 3 shows the schedule block as you wrote it.

3. Apply

terraform init -upgrade
terraform plan
terraform apply

The plan ends with Plan: 1 to add, 0 to change, 0 to destroy. The apply ends with Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

4. Check the first snapshot

After the next 2:00 in your timezone, list the protected directory's .snapshot directory from a client. It holds a snapshot whose name contains daily-backup, the policy name.

Next

Snapshot concepts are in Qumulo's snapshot documentation, and policies are in Qumulo's guide to managing snapshots. Replication to a second cluster carries a copy off this one, the qumulo_snapshot_policy reference lists every schedule option, Manage several clusters from one configuration applies the same policy across a fleet, and the cluster troubleshooting guide helps if a step fails.