ALIYUN::ECS::Disk类型用于创建ECS云盘。

语法

{
  "Type": "ALIYUN::ECS::Disk",
  "Properties": {
    "StorageSetId": String,
    "Description": String,
    "Tags": List,
    "AutoSnapshotPolicyId": String,
    "Encrypted": Boolean,
    "DiskName": String,
    "DiskCategory": String,
    "ResourceGroupId": String,
    "KMSKeyId": String,
    "DeleteAutoSnapshot": Boolean,
    "SnapshotId": String,
    "StorageSetPartitionNumber": Integer,
    "PerformanceLevel": String,
    "ZoneId": String,
    "Size": Integer,
    "BurstingEnabled": Boolean,
    "ProvisionedIops": Integer,
    "MultiAttach": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
ResourceGroupId String 云盘所在的资源组ID。
ZoneId String 可用区ID。
DiskName String 云盘的名称。 长度为2~128个字符。必须以英文字母或汉字开头,不能以http://https://开头。可包含英文字母、汉字、数字、半角句号(.)、下划线(_)和短划线(-)。
Description String 云盘的描述。 长度为2~256个字符。不能以http://https:// 开头。
Tags List 标签。 最多支持20个标签。

更多信息,请参见Tags属性

DiskCategory String 云盘的类型。 取值:
  • cloud(默认值):普通云盘。
  • cloud_efficiency:高效云盘。
  • cloud_ssd:SSD云盘。
  • cloud_essd:ESSD云盘。
SnapshotId String 快照ID。 同时指定该参数和Size时,以该参数取值为准。

实际创建的云盘大小为指定快照的大小。

说明 2013年07月15日及以前创建的快照不能用来创建云盘。
PerformanceLevel String ESSD云盘性能等级。 取值:
  • PL0:单盘最高随机读写IOPS 1万。
  • PL1(默认值):单盘最高随机读写IOPS 5万。
  • PL2:单盘最高随机读写IOPS 10万。
  • PL3:单盘最高随机读写IOPS 100万。
有关如何选择ESSD云盘性能等级,请参见ESSD云盘
Size Integer 云盘的大小。 取值范围:
  • cloud:5~2000。
  • cloud_efficiency:20~32,768。
  • cloud_ssd:20~32,768。
  • cloud_essd:20~32,768。

单位:GiB。

指定该参数后,其取值必须大于或等于指定快照的大小。

BurstingEnabled Boolean 是否启用突发。 取值:
  • true:启用。
  • false(默认值):禁用。
ProvisionedIops Integer 预配的IOPS。
AutoSnapshotPolicyId String 自动快照策略ID。
Encrypted Boolean 是否加密云盘。 取值:
  • true:加密。
  • false(默认值):不加密。
DeleteAutoSnapshot Boolean 删除云盘时是否删除自动快照。 取值范围:
  • true(默认值):删除云盘时同步删除自动快照。
  • false:删除云盘时不删除自动快照。
StorageSetId String 存储集ID。
KMSKeyId String 云盘使用的KMS密钥ID。
StorageSetPartitionNumber Integer 存储集分区数。
MultiAttach String 是否开启多重挂载特性。 取值:
  • Disabled(默认值):不开启。
  • Enabled : 开启。目前仅ESSD云盘支持设置为Enabled。
说明 开启多重挂载特性的云盘只支持按量付费。

Tags语法

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

Tags属性

属性名称 类型 必须 允许更新 描述 约束
Key String 标签键。 长度为1~128个字符,不能以aliyunacs:开头,不能包含http://https://
Value String 标签值。 长度为0~128个字符,不能以aliyunacs:开头,不能包含http://https://

返回值

Fn::GetAtt

  • DiskId:云盘ID。
  • Status:云盘状态。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ZoneId:
        AssociationProperty: ALIYUN::ECS::Instance:ZoneId
        Type: String
        Label:
          zh-cn: 交换机可用区
          en: VSwitch Availability Zone
    Resources:
      DataDisk:
        Type: ALIYUN::ECS::Disk
        Properties:
          Size: 10
          ZoneId:
            Ref: ZoneId
          DiskName: DataDisk
    Outputs:
      DiskId:
        Value:
          Fn::GetAtt:
            - DataDisk
            - DiskId
      Status:
        Value:
          Fn::GetAtt:
            - DataDisk
            - Status
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ZoneId": {
          "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
          "Type": "String",
          "Label": {
            "zh-cn": "交换机可用区",
            "en": "VSwitch Availability Zone"
          }
        }
      },
      "Resources": {
        "DataDisk": {
          "Type": "ALIYUN::ECS::Disk",
          "Properties": {
            "Size": 10,
            "ZoneId": {
              "Ref": "ZoneId"
            },
            "DiskName": "DataDisk"
          }
        }
      },
      "Outputs": {
        "DiskId": {
          "Value": {
            "Fn::GetAtt": [
              "DataDisk",
              "DiskId"
            ]
          }
        },
        "Status": {
          "Value": {
            "Fn::GetAtt": [
              "DataDisk",
              "Status"
            ]
          }
        }
      }
    }

更多示例,请参见:JSON示例YAML示例