lbcli create snapshots-policy (2.2 and above)

AI Tools

Creates a new snapshots policy.

Synopsis

Create a new policy for periodic generation of snapshots for a specified volume. Snapshots will be created periodically for specified volumes at defined intervals. These snapshots will be deleted after the defined retention time expires.

lbcli create snapshots-policy [flags]

Examples;

# Create a snapshots policy. lbcli -J $JWT create snapshots-policy --project-name=proj1 --name=policy1 --volume-uuid=302e7970-b138-11e9-91d4-525401643394 --description="my policy" --hours-in-cycle=2 --start-time=22:30 --retention-time=7200s lbcli -J $JWT create snapshots-policy --project-name=proj1 --name=policy1 --volume-name=volume_0 --description="my policy" --days-in-cycle=3 --start-time=08:20 --retention-time=48h

Flag

Short

Type

Default

Description

--description


string


Snapshot policy description (optional)

--help

-h

bool


Help for snapshots-policy.

--name


string


Snapshot policy name (required).

--project-name


string


The project name (required).

--retention-time


string


Retention time to keep the snapshot, before deleting it (optional). Retention time is encoded as a string with a {value}{unit} format. {value} is a decimal number and {unit} is one of the following: ns, us, ms, s, m, h. Example: 7200s, 1200m, 2h.

--volume-name


string


Volume name to assign policy to (required if volume-UUID was not provided).

--volume-UUID


string


Volume UUID to assign policy to (required if volume-name was not provided).

--days-in-cycle


int


Specifies the time interval between the creation of snapshots (in units of days). Valid values are in the range of 1 to 6 days. You must specify either this flag or --hours-in-cycle to specify the rate of snapshots creation.

--hours-in-cycle


int


Specifies the time interval between the creation of snapshots (in units of hours). Valid values are in the range of 1 to 23 hours. You must specify either this flag or --days-in-cycle to specify the rate of snapshots creation.

--start-time


int


The scheduled start time. In daily policy, this defines the reoccurring time of day that a snapshot is created. For hourly snapshots, this defines the time within the hour that a snapshot is created. This must be in the form of HH:MM, in which HH is hours and MM is minutes.