全部产品
Search
文档中心

CloudOps Orchestration Service:ACS-ECS-ScheduleToBulkyCreateSnapshot

更新时间:Dec 21, 2025

Nama template

ACS-ECS-ScheduleToBulkyCreateSnapshot: Pembuatan snapshot batch terjadwal

Eksekusi Sekarang

Deskripsi template

Membuat snapshot untuk beberapa disk sesuai jadwal.

Tipe template

Otomatis

Pemilik

Alibaba Cloud

Parameter input

Parameter

Deskripsi

Tipe

Diperlukan

Nilai default

Batasan

timerTrigger

Jenis tugas terjadwal

Json

Ya

diskIds

Disk ID

Daftar

Ya

regionId

ID wilayah.

String

Tidak

{{ ACS::RegionId }}

retentionDays

Periode retensi snapshot.

Angka

Tidak

0

tags

Tag snapshot.

Json

Tidak

[]

rateControl

Laju Eksekusi Bersamaan

Json

Tidak

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

OOSAssumeRole

Peran Resource Access Management (RAM) yang diasumsikan oleh CloudOps Orchestration Service (OOS).

String

Tidak

OOSServiceRole

Parameter keluaran

Parameter

Deskripsi

Tipe

createdSnapshotIds

Daftar

Kebijakan izin yang diperlukan untuk mengeksekusi template

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

Detail

Untuk informasi lebih lanjut, lihat ACS-ECS-ScheduleToBulkyCreateSnapshot.yml di GitHub.

Konten Template

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 }}'