ALIYUN::ECS::SnapshotGroup

ALIYUN::ECS::SnapshotGroup类型用于为指定ECS实例中的云盘创建快照一致性组。快照一致性组包含一个或多个云盘对应的快照。

语法

{
  "Type": "ALIYUN::ECS::SnapshotGroup",
  "Properties": {
    "DiskIds": List,
    "Description": String,
    "ExcludeDiskIds": List,
    "InstanceId": String,
    "Name": String,
    "ResourceGroupId": String,
    "Tags": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

DiskIds

List

指定创建快照一致性组的云盘 ID。

在同可用区内支持跨实例设置多个云盘 ID。一个快照一致性组内最多支持设置 16 块总大小不超过 32 TiB 的云盘。

说明
  • 该参数不可与ExcludeDiskIds同时设置。

  • 如果您设置了InstanceId,则该参数只能设置指定实例内已挂载的云盘,不再支持设置多个跨实例的云盘 ID。

Description

String

描述。

长度为 2~256 个字符,不能以http://https://开头。

ExcludeDiskIds

List

实例中不需要创建快照的云盘 ID。

指定云盘 ID 后,创建的快照一致性组将不包含该云盘对应的快照。最多支持配置16个快照的云盘 ID。

默认值:空,表示为实例中的所有云盘创建快照。

说明

该参数不可与DiskIds同时设置。

InstanceId

String

实例 ID。

Name

String

快照一致性组名称。

长度为 2~128 个英文或中文字符。必须以大小写字母或中文开头,不能以http://https://开头,可以包含数字、半角句号(.)、下划线(_)、短划线(-)或者半角冒号(:)。

ResourceGroupId

String

快照一致性组所属的资源组 ID。

Tags

List

标签。

最多支持添加20个标签。

更多信息,请参见Tags属性。

Tags语法

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Key

String

标签键。

Value

String

标签值。

返回值

Fn::GetAtt

SnapshotGroupId:快照一致性组 ID。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      DiskIds:
        AssociationPropertyMetadata:
          Parameter:
            Type: String
            Description:
              en: The ID of cloud disk for which you want to create snapshots.
            Required: false
        AssociationProperty: List[Parameter]
        Type: Json
        Description:
          en: |-
            The IDs of cloud disk for which you want to create snapshots. You can specify multiple cloud disk IDs across instances within the same zone. The length of the list ranges from 1 to 16. A single snapshot-consistent group can contain snapshots of up to 16 cloud disks whose total disk size does not exceed 32 TiB.
            Take note of the following items:
            You cannot specify both DiskIds and ExcludeDiskIdin the same request.
            If InstanceId is set, you can use DiskIds to specify only cloud disks attached to the instance specified by InstanceId, and you cannot use DiskIds to specify cloud disks attached to multiple instances.
        Required: false
      InstanceId:
        Type: String
        AssociationProperty: ALIYUN::ECS::Instance::InstanceId
        Description:
          en: The instance ID.
        Required: false
      Name:
        Type: String
        Description:
          en: The name of the snapshot-consistent group. The name must be 2 to 128 characters in length. The name can contain letters, digits, periods (.), underscores (_), hyphens (-), and colons (:). It must start with a letter and cannot start with http:// or https://.
        Required: false
    Resources:
      SnapshotGroup:
        Type: ALIYUN::ECS::SnapshotGroup
        Properties:
          DiskIds:
            Ref: DiskIds
          InstanceId:
            Ref: InstanceId
          Name:
            Ref: Name
    Outputs:
      SnapshotGroupId:
        Description: The ID of the snapshot-consistent group.
        Value:
          Fn::GetAtt:
            - SnapshotGroup
            - SnapshotGroupId
    
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "DiskIds": {
          "AssociationPropertyMetadata": {
            "Parameter": {
              "Type": "String",
              "Description": {
                "en": "The ID of cloud disk for which you want to create snapshots."
              },
              "Required": false
            }
          },
          "AssociationProperty": "List[Parameter]",
          "Type": "Json",
          "Description": {
            "en": "The IDs of cloud disk for which you want to create snapshots. You can specify multiple cloud disk IDs across instances within the same zone. The length of the list ranges from 1 to 16. A single snapshot-consistent group can contain snapshots of up to 16 cloud disks whose total disk size does not exceed 32 TiB.\nTake note of the following items:\nYou cannot specify both DiskIds and ExcludeDiskIdin the same request.\nIf InstanceId is set, you can use DiskIds to specify only cloud disks attached to the instance specified by InstanceId, and you cannot use DiskIds to specify cloud disks attached to multiple instances."
          },
          "Required": false
        },
        "InstanceId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::Instance::InstanceId",
          "Description": {
            "en": "The instance ID."
          },
          "Required": false
        },
        "Name": {
          "Type": "String",
          "Description": {
            "en": "The name of the snapshot-consistent group. The name must be 2 to 128 characters in length. The name can contain letters, digits, periods (.), underscores (_), hyphens (-), and colons (:). It must start with a letter and cannot start with http:// or https://."
          },
          "Required": false
        }
      },
      "Resources": {
        "SnapshotGroup": {
          "Type": "ALIYUN::ECS::SnapshotGroup",
          "Properties": {
            "DiskIds": {
              "Ref": "DiskIds"
            },
            "InstanceId": {
              "Ref": "InstanceId"
            },
            "Name": {
              "Ref": "Name"
            }
          }
        }
      },
      "Outputs": {
        "SnapshotGroupId": {
          "Description": "The ID of the snapshot-consistent group.",
          "Value": {
            "Fn::GetAtt": [
              "SnapshotGroup",
              "SnapshotGroupId"
            ]
          }
        }
      }
    }