protectionpolicy create

Prev Next

This command creates a protection policy.

Usage

protectionpolicy create --clone-type CLOUD_REPLICATION|LOCAL|NATIVE_REPLICATION
                        --name POLICY_NAME 
                        --schedule SCHEDULE 
                        --snapshot-prefix PREFIX
                        [--peer-id PEER_ID]
                        [--enable-lock]

Required Parameters

--clone-type CLOUD_REPLICATION|NATIVE_REPLICATION|LOCAL

Specifies what type of protection to configure on the path:

  • CLOUD_REPLICATION. Take local snapshots and replicate them to an S3 replication peer.

  • NATIVE_REPLICATION. Take local snapshots and replicate them to an async replication peer.

  • LOCAL. Take snapshots on the local cluster only.

--name POLICY_NAME

Specifies a name for the protection policy.

--schedule SCHEDULE

Defines the schedule for snapshots and replication.

The schedule includes a period defined as a number of time units, a start date and time, a retention time limit for local snapshots and, for async replication, a retention time for remote snapshots.

Specify SCHEDULE in the following format:

every <number><time units> start at YYYY-MM-DD HH:MM:SS keep-local <number><time units> keep-remote <number><time units>

Where:

  • <time units> can be any of the following:

    • s - seconds

    • m - minutes

    • h - hours

    • d - days

    • W - weeks

    • M - months

    • Y - years

    Notice

    The W, M and Y options are available starting with VAST Cluster 4.6.0-SP22.

  • keep-local sets the amount of time to retain each local snapshot on the cluster.

    Note

    If --clone-type is set to CLOUD_REPLICATION, then the minimum supported period is 6 hours, which can be specified as 6h.

  • keep-remote sets the amount of time to retain each snapshot on an async replication remote peer.

    Note

    S3 backups do not expire and do not have a retention period.

Example: --schedule every 90m start-at 2025-07-27 20:10:35 keep-local 10h keep-remote 7d

--snapshot-prefix PREFIX

Specifies the prefix to use in the names of snapshots.

The name of each snapshot will be <prefix>_<timestamp>, where <prefix> is the prefix specified here and <timestamp> is the time the snapshot is created, in the format yyyy-mm-ddTHH:MM:SS.SSSSSSzzz (T denotes time and doesn't represent a value, zzz is the timezone, and the time is accurate to the microsecond). For example, if the prefix is dev, a snapshot taken at 8:15 pm UTC on 20th November 2024 would be named dev_2024-11-20T20:15:06.144783UTC.

--enable-lock

Makes the policy indestructible. Once this setting is enabled, deleting or modifying the protection policy requires unlocking the cluster's indestructibility mechanism.

Options

--peer-id PEER_ID

Specifies the replication peer if --clone-type is either CLOUD_REPLICATION or NATIVE_REPLICATION.

If --clone-type is CLOUD_REPLICATION, specify the ID of an S3 replication peer.

If --clone-type is NATIVE_REPLICATION, specify the ID of an async replication peer.

Specify the ID as an integer.

Example

vcli: admin> protectionpolicy create --schedule every 90m start at 2025-07-27 20:10:35 keep-local 10h keep-remote 10d --prefix Snapdir1 --clone-type NATIVE_REPLICATION  --name protect-pol1 --peer-id 1