dcloud ec2 snapshot-policies createSnapshot instances on a schedule and keep the newest N per instance
Targets are instance ids, tags, or both; at least one is required. A snapshot of a running instance is crash-consistent, like an EBS snapshot.
Synopsis
dcloud ec2 snapshot-policies create --name name --interval-hours intervalHours --start-time startTime --retain-count retainCount --region-id regionId [flags]Flags
--nameRequiredstring
A display name
Constraints: 1-64 chars
--descriptionOptionalstring
Free text; null clears it
Constraints: max 255 chars
May be null.
--enabledOptionalboolean (--enabled / --no-enabled)
A paused policy takes nothing and keeps its images
--target-instance-idsOptionalarray of string
Instances to snapshot (i-…)
Constraints: /^i-[0-9a-f]{6,32}$/
--target-tagsOptionalmap of string
Also snapshot every instance that carries all of these tags
Constraints: key=value
--interval-hoursRequirednumber
Hours between runs: 1, 2, 3, 4, 6, 8, 12, 24 or 168 (weekly, on Mondays)
Constraints: integer
--start-timeRequiredstring
HH:MM UTC; runs fall on this time plus whole intervals
Constraints: /^([01]\d|2[0-3]):[0-5]\d$/
--retain-countRequirednumber
Images kept per instance; older ones this policy took are deregistered
Constraints: integer, 1-100
--region-idRequiredstring
The region the policy belongs to, e.g. de1
Constraints: 1-32 chars
Example
dcloud ec2 snapshot-policies create --name example --interval-hours 1 --start-time example --retain-count 1 --region-id exampleGenerated from the API description, the same one the API checks requests against and the CLI is built from.