All Products
Search
Document Center

CloudOps Orchestration Service:ACS-ECS-BulkyCreateSnapshot

Last Updated:Dec 23, 2025

Template name

ACS-ECS-BulkyCreateSnapshot

Execute Now

Template description

Creates snapshots for multiple disks at a time.

Template type

Automated

Owner

Alibaba Cloud

Request parameter

Parameter

Description

Type

Required

Default value

Limit

diskIds

Disk ID

List

Yes

regionId

The region ID.

String

No

{{ ACS::RegionId }}

retentionDays

The retention period of snapshots.

Number

No

0

tags

The tags of the snapshots.

Json

No

[]

rateControl

Task execution concurrency ratio

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

""

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-BulkyCreateSnapshot.yml at GitHub.

Template content

FormatVersion: OOS-2019-06-01
Description:
  en: Bulky create snapshot
  zh-cn: Creates snapshots for multiple disks.
  name-en: ACS-ECS-BulkyCreateSnapshot
  name-zh-cn: Create Snapshots for Multiple Disks
  categories:
    - data_backup
Parameters:
  regionId:
    Type: String
    Label:
      en: RegionId
      zh-cn: Region ID
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  diskIds:
    Label:
      en: DiskIds
      zh-cn: Disk IDs
    Type: List
    AssociationProperty: ALIYUN::ECS::Disk::DiskId
    AssociationPropertyMetadata:
      RegionId: regionId
  retentionDays:
    Label:
      en: RetentionDays
      zh-cn: Snapshot Retention Period
    Description:
      en: The unit is days. Snapshots are automatically released after the retention period expires. The default value is 0, which means the snapshot is never automatically released.
      zh-cn: The unit is days. Snapshots are automatically released after the retention period expires. A value of 0 means that the snapshot is never automatically released.
    Type: Number
    MaxValue: 65536
    MinValue: 0
    Default: 0
  tags:
    Label:
      en: Tags
      zh-cn: Snapshot Tags
    Type: Json
    AssociationProperty: Tags
    AssociationPropertyMetadata:
      ShowSystem: false
    Default: []
  rateControl:
    Label:
      en: RateControl
      zh-cn: Task Execution Concurrency
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: RAM Role Assumed by OOS
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: createSnapshot
    Action: 'ACS::ECS::CreateSnapshot'
    Description:
      en: Create a snapshot for a cloud disk
      zh-cn: Creates a snapshot for a disk.
    Properties:
      regionId: '{{ regionId }}'
      diskId: '{{ ACS::TaskLoopItem }}'
      tags: '{{ tags }}'
      retentionDays:
        Fn::If:
          - Fn::Equals:
            - '{{ retentionDays }}'
            - 0
          - ''
          - '{{ retentionDays }}'
    Loop:
      RateControl: '{{ rateControl }}'
      Items: '{{ diskIds }}'
      Outputs:
        snapshotIds:
          AggregateType: 'Fn::ListJoin'
          AggregateField: snapshotId
Outputs:
  createdSnapshotIds:
    Type: List
    Value: '{{ createSnapshot.snapshotIds }}'
Metadata:
  ALIYUN::OOS::Interface:
    ParameterGroups:
      - Parameters:
          - diskIds
          - retentionDays
          - tags
        Label:
          default:
            zh-cn: Configuration Parameters
            en: Configure Parameters
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: Advanced Options
            en: Control Options