• 地址:广州市天河区华南植物园-龙洞慧创百思G220
  • 免费热线 : 020-87581205
  • 电子邮箱 : sw@51mimu.com

ALIYUN::ECS::DiskAttachment_ECS_资源类型_资源编排-阿里云

 知识中心     |      2020-05-19 09:50:08

ALIYUN::ECS::DiskAttachment

更新时间:2020-03-26 16:36:38

编辑 我的收藏

新浪微博 微信 钉钉

本页目录

ALIYUN::ECS::DiskAttachment用于挂载ECS磁盘。

语法

{
  "Type": "ALIYUN::ECS::DiskAttachment",
  "Properties": {
    "InstanceId": String,
    "Device": String,
    "DeleteWithInstance": Boolean,
    "DiskId": String,
    "DeleteAutoSnapshot": Boolean
  }
}

属性

名称 类型 必须 允许更新 描述 约束
InstanceId String 需挂载磁盘的实例ID。 无。
DiskId String 磁盘ID。 磁盘和ECS实例必须在同一个可用区。
Device String 磁盘设备名。 如不指定,则默认由系统按顺序分配,即从 /dev/xvdb 到 /dev/xvdz。
DeleteWithInstance Boolean 磁盘是否随实例释放。 取值范围:
  • true:释放实例时,该云盘随实例一起释放。
  • false:释放实例时,保留该云盘,不随实例一起释放。
DeleteAutoSnapshot Boolean 删除数据盘时是否删除自动快照。 取值范围:true(默认值)、false。

返回值

Fn::GetAtt

  • DiskId:新建磁盘的ID。
  • Status:新建磁盘的状态。
  • Device:磁盘设备名。

示例

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "DiskAttachment": {
      "Type": "ALIYUN::ECS::DiskAttachment",
      "Properties": {
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "Device": {
          "Ref": "Device"
        },
        "DeleteWithInstance": {
          "Ref": "DeleteWithInstance"
        },
        "DiskId": {
          "Ref": "DiskId"
        }
      }
    }
  },
  "Parameters": {
    "InstanceId": {
      "Type": "String",
      "Description": "The instanceId to attach the disk."
    },
    "Device": {
      "Type": "String",
      "Description": "The device where the volume is exposed on the instance. could be /dev/xvd[a-z]. If not specification, will use default value."
    },
    "DeleteWithInstance": {
      "Type": "Boolean",
      "Description": "If property is true, the disk will be deleted while instance is deleted, if property is false, the disk will be retain after instance is deleted.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "DiskId": {
      "Type": "String",
      "Description": "The disk id to attached."
    }
  },
  "Outputs": {
    "Status": {
      "Description": "The disk status now.",
      "Value": {
        "Fn::GetAtt": [
          "DiskAttachment",
          "Status"
        ]
      }
    },
    "Device": {
      "Description": "The device where the volume is exposed on ecs instance.",
      "Value": {
        "Fn::GetAtt": [
          "DiskAttachment",
          "Device"
        ]
      }
    },
    "DiskId": {
      "Description": "The disk id of created disk",
      "Value": {
        "Fn::GetAtt": [
          "DiskAttachment",
          "DiskId"
        ]
      }
    }
  }
}


COPYRIGHT © 2018-2019,WWW.51MIMU.COM,ALL RIGHTS RESERVED版权所有 © 广州米姆信息科技有限公司(阿里云、腾讯云代理商) 粤ICP备18145377号

sitemap feed