All Products
Search
Document Center

CloudOps Orchestration Service:ACS-ECS-BulkyCreateSnapshot

Last Updated:Sep 20, 2024

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

The IDs of disks for which you want to create snapshots.

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

The rate control settings.

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"
        }
    ]
}

References

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

Template content

FormatVersion: OOS-2019-06-01
Description:
  en: Bulky create snapshot
  zh-cn: the description in Chinese
  name-en: ACS-ECS-BulkyCreateSnapshot
  name-zh-cn: the description in Chinese
  categories:
    - data_backup
Parameters:
  regionId:
    Type: String
    Label:
      en: RegionId
      zh-cn: the description in Chinese
    AssociationProperty: RegionId
    Default: '{{ ACS::RegionId }}'
  diskIds:
    Label:
      en: DiskIds
      zh-cn: the description in Chinese
    Type: List
    AssociationProperty: ALIYUN::ECS::Disk::DiskId
    AssociationPropertyMetadata:
      RegionId: regionId
  retentionDays:
    Label:
      en: RetentionDays
      zh-cn: the description in Chinese
    Description:
      en: The unit is day. Snapshots are automatically released after the retention time expires.The default is 0, indicating that the snapshot will not be automatically released.
      zh-cn: the description in Chinese  
    Type: Number
    MaxValue: 65536
    MinValue: 0
    Default: 0
  tags:
    Label:
      en: Tags
      zh-cn: the description in Chinese
    Type: Json
    AssociationProperty: Tags
    AssociationPropertyMetadata:
      ShowSystem: false
    Default: []
  rateControl:
    Label:
      en: RateControl
      zh-cn: the description in Chinese
    Type: Json
    AssociationProperty: RateControl
    Default:
      Mode: Concurrency
      MaxErrors: 0
      Concurrency: 10
  OOSAssumeRole:
    Label:
      en: OOSAssumeRole
      zh-cn: the description in Chinese
    Type: String
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: createSnapshot
    Action: 'ACS::ECS::CreateSnapshot'
    Description:
      en: Create a snapshot for a cloud disk
      zh-cn: the description in Chinese
    Properties:
      diskId: '{{ ACS::TaskLoopItem }}'
      tags: '{{ tags }}'
      retentionDays:
        Fn::If:
          - Fn::Equals:
            - '{{ retentionDays }}'
            - 0
          - ''
          - '{{ retentionDays }}'
    Outputs:
      snapshotId:
        Type: String
        ValueSelector: .snapshotId
    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: the description in Chinese
            en: Configure Parameters
      - Parameters:
          - rateControl
          - OOSAssumeRole
        Label:
          default:
            zh-cn: the description in Chinese
            en: Control Options