All Products
Search
Document Center

CloudOps Orchestration Service:ACS-ECS-ResetDiskWithSnapshot

Last Updated:Nov 25, 2024

Template name

ACS-ECS-ResetDiskWithSnapshot

Run Now

Template description

Uses a snapshot to reset a disk.

Template type

Automated

Owner

Alibaba Cloud

Input parameters

Parameter

Description

Type

Required

Default value

Limit

regionId

The region ID.

String

Yes

instanceId

The ID of the Elastic Compute Service (ECS) instance.

String

Yes

diskId

The disk ID.

String

Yes

snapshotId

The snapshot ID.

String

Yes

OOSAssumeRole

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

String

No

""

Output parameters

None

Permission policy that is required to execute the template

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeDisks",
                "ecs:DescribeInstances",
                "ecs:ResetDisk",
                "ecs:StartInstance",
                "ecs:StopInstance"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

References

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

Template content

FormatVersion: OOS-2019-06-01
Description:
  en: Use snapshot to create a temporary cloud disk to restore data
  zh-cn: the description in Chinese
  name-en: ACS-ECS-ResetDiskWithSnapshot
  name-zh-cn: the description in Chinese
  categories:
    - instance_manage
    - computenest
    - application_manage
Parameters:
  regionId:
    Type: String
    Label:
      en: RegionId
      zh-cn: the description in Chinese
    AssociationProperty: RegionId
  instanceId:
    Type: String
    Label:
      en: InstanceId
      zh-cn: the description in Chinese
    AssociationProperty: ALIYUN::ECS::Instance::InstanceId
    AssociationPropertyMetadata:
      RegionId: regionId
      Status: Running
  diskId:
    Type: String
    Label:
      en: Disk id
      zh-cn: the description in Chinese
    AssociationProperty: ALIYUN::ECS::Disk::DiskId
    AssociationPropertyMetadata:
      RegionId: regionId
      InstanceId: instanceId
  snapshotId:
    Type: String
    Label:
      en: Snapshot id
      zh-cn: the description in Chinese
    AssociationProperty: ALIYUN::ECS::Snapshot::SnapshotId
    AssociationPropertyMetadata:
      DiskId: diskId
  OOSAssumeRole:
    Type: String
    Label:
      en: OOSAssumeRole
      zh-cn: the description in Chinese
    Default: ''
RamRole: '{{ OOSAssumeRole }}'
Tasks:
  - Name: resetDisk
    Action: 'ACS::ECS::ResetDisk'
    Description:
      en: Resets the ECS disk
      zh-cn: the description in Chinese
    Properties:
      regionId: '{{ regionId }}'
      diskId: '{{ diskId }}'
      snapshotId: '{{ snapshotId }}'
      instanceId: '{{ instanceId }}'