dcloud ec2 snapshot-policies create

Snapshot instances on a schedule and keep the newest N per instance

IAM ec2:CreateSnapshotPolicyChanges state

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

  • --nameRequired

    string

    A display name

    Constraints: 1-64 chars

  • --descriptionOptional

    string

    Free text; null clears it

    Constraints: max 255 chars

    May be null.

  • --enabledOptional

    boolean (--enabled / --no-enabled)

    A paused policy takes nothing and keeps its images

  • --target-instance-idsOptional

    array of string

    Instances to snapshot (i-…)

    Constraints: /^i-[0-9a-f]{6,32}$/

  • --target-tagsOptional

    map of string

    Also snapshot every instance that carries all of these tags

    Constraints: key=value

  • --interval-hoursRequired

    number

    Hours between runs: 1, 2, 3, 4, 6, 8, 12, 24 or 168 (weekly, on Mondays)

    Constraints: integer

  • --start-timeRequired

    string

    HH:MM UTC; runs fall on this time plus whole intervals

    Constraints: /^([01]\d|2[0-3]):[0-5]\d$/

  • --retain-countRequired

    number

    Images kept per instance; older ones this policy took are deregistered

    Constraints: integer, 1-100

  • --region-idRequired

    string

    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 example

Generated from the API description, the same one the API checks requests against and the CLI is built from.