All Products
Search
Document Center

CloudOps Orchestration Service:ACS-ECS-ScheduleToBulkyCreateSnapshot

Last Updated:Dec 24, 2025

Template name

ACS-ECS-ScheduleToBulkyCreateSnapshot Scheduled batch snapshot creation

Execute Now

Template description

Creates snapshots for multiple disks at a time as scheduled.

Template type

Automated

Owner

Alibaba Cloud

Input parameters

Parameter

Description

Type

Required

Default value

Limit

timerTrigger

The type of the scheduled task

Json

Yes

diskIds

Disk ID

List

Yes

regionId

The region ID.

String

No

{{ ACS::RegionId }}

retentionDays

The retention period of the snapshot.

Number

No

0

tags

The tags of the snapshot.

Json

No

[]

rateControl

Concurrent Execution Rate

Json

No

{'Mode': 'Concurrency', 'MaxErrors': 0, 'Concurrency': 10}

OOSAssumeRole

The Resource Access Management (RAM) role that is assumed by CloudOps Orchestration Service (OOS).

String

No

OOSServiceRole

Output parameters

Parameter

Description

Type

createdSnapshotIds

List

Permission policy that is required to execute the template

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:CreateSnapshot",
                "ecs:DescribeDisks",
                "ecs:DescribeInstances",
                "ecs:DescribeSnapshots"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

Details

For more information, see ACS-ECS-ScheduleToBulkyCreateSnapshot.yml at GitHub.

Template content

FormatVersion: OOS-2019-06-01
Description:
  en: Schedules the batch creation of snapshots.
  name-en: ACS-ECS-ScheduleToBulkyCreateSnapshot
Parameters:
  regionId:
    Label:
      en: Region ID
    Type: String
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  timerTrigger:
    Type: Json
    Label:
      en: Schedule
    AssociationProperty: ALIYUN::OOS::Component::TimerTrigger
    AssociationPropertyMetadata:
      MinuteInterval: 30
  diskIds:
    Label:
      en: Disk IDs
    AssociationProperty: ALIYUN::ECS::Disk::DiskId
    AssociationPropertyMetadata:
      RegionId: regionId
    Type: List
  retentionDays:
    Label:
      en: Retention Period (Days)
    Description:
      en: The retention period of the snapshots, in days. After the retention period expires, the snapshots are automatically released. A value of 0 indicates that the snapshots are not automatically released.
    Type: Number
    MaxValue: 65536
    MinValue: 0
    Default: 0
  tags:
    Label:
      en: Snapshot Tags
    Type: Json
    AssociationProperty: Tags
    AssociationPropertyMetadata:
      ShowSystem: false
    Default: []
  rateControl:
    Label:
      en: Concurrency Control
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: RAM Role for OOS
    Type: String
    Default: OOSServiceRole
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: timerTrigger
    Action: ACS::TimerTrigger
    Description:
      en: Triggers the task on a schedule.
    Properties:
      Type:
        Fn::Select:
          - type
          - '{{timerTrigger}}'
      Expression:
        Fn::Select:
          - expression
          - '{{timerTrigger}}'
      StartDate:
        Fn::Select:
          - startDate
          - '{{ timerTrigger }}'
      EndDate:
        Fn::Select:
          - endDate
          - '{{ timerTrigger }}'
      TimeZone:
        Fn::Select:
          - timeZone
          - '{{ timerTrigger }}'
  - Name: createSnapshot
    Action: ACS::ECS::CreateSnapshot
    Description:
      en: Creates a snapshot for a disk.
    Properties:
      regionId: '{{ regionId }}'
      diskId: '{{ ACS::TaskLoopItem }}'
      retentionDays:
        Fn::If:
          - Fn::Equals:
              - '{{ retentionDays }}'
              - 0
          - ''
          - '{{ retentionDays }}'
      tags: '{{ tags }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ diskIds }}'
      Outputs:
        snapshotIds:
          AggregateType: Fn::ListJoin
          AggregateField: snapshotId
Outputs:
  createdSnapshotIds:
    Type: List
    Value: '{{ createSnapshot.snapshotIds }}'