全部产品
Search
文档中心

资源编排:ALIYUN::ECS::DedicatedHost

更新时间:Apr 17, 2023

ALIYUN::ECS::DedicatedHost用于创建专有宿主机。

语法

{
  "Type": "ALIYUN::ECS::DedicatedHost",
  "Properties": {
    "DedicatedHostType": String,
    "DedicatedHostName": String,
    "PeriodUnit": String,
    "AutoReleaseTime": String,
    "Description": String,
    "AutoPlacement": String,
    "Tags": List,
    "AutoRenewPeriod": Number,
    "ActionOnMaintenance": String,
    "Period": Number,
    "AutoRenew": String,
    "NetworkAttributesSlbUdpTimeout": Integer,
    "ChargeType": String,
    "ResourceGroupId": String,
    "ZoneId": String,
    "NetworkAttributesUdpTimeout": Integer,
    "Quantity": Integer
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

DedicatedHostType

String

专有宿主机的类型。

DedicatedHostName

String

专有宿主机的名称。

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

PeriodUnit

String

续费单位。

取值:

  • Week

  • Month(默认值)

  • Year

AutoReleaseTime

String

自动释放时间。

如果不指定AutoReleaseTime参数,表示取消自动释放,专有宿主机在预约时间点不再自动释放。

自动释放时间最短不能晚于当前时间半小时内,最长不能超过当前时间三年以后。

如果秒(ss)取值不是 00,则自动取当前分钟(mm)开始时刻。

Description

String

专有宿主机的描述。

AutoRenewPeriod

Number

单次自动续费的周期。

取值:1、2、3、6、12。

单位:月。

Period

Number

预付费时长。

取值:

  • PeriodUnit=Week时:1、2、3。

  • PeriodUnit=Month时:1、2、3、4、5、6、7、8、9。

  • PeriodUnit=Year时:1、2、3、4、5。

ZoneId

String

专有宿主机所属的可用区ID。

默认值:空,表示由系统选择。

AutoRenew

String

是否自动续费预付费的专有宿主机。

取值:

  • True

  • False(默认值)

ChargeType

String

专有宿主机的计费方式。

取值:

  • PrePaid:预付费,即包年包月。

    选择预付费时,请确认您的支付方式支持余额或者信用额度支付,否则会提示 InvalidPayMethod

  • PostPaid:按量付费。

AutoPlacement

String

专有宿主机是否加入自动部署资源池。

取值:

  • on(默认值):专有宿主机加入自动部署资源池。

  • off:专有宿主机不加入自动部署资源池。

当您在专有宿主机上创建实例,却不指定DedicatedHostId时,阿里云将自动从加入资源池的专有宿主机中,为您选取适合的宿主机部署实例。更多信息,请参见功能特性

Tags

List

用户自定义标签。

最多支持20个标签,格式:[{"Key": "tagKey", "Value": "tagValue"},{"Key": "tagKey2", "Value": "tagValue2"}]

更多信息,请参见Tags属性

ActionOnMaintenance

String

当专有宿主机发生故障或者在线修复时,为其所宿实例设置迁移方案。

取值:

  • Migrate:迁移实例到其他物理机并重新启动实例。

  • Stop:在当前专有宿主机上停止实例,确认无法修复专有宿主机后,迁移实例到其他物理机并重新启动实例。

当专有宿主机上挂载云盘存储时默认值为Migrate,当专有宿主机上挂载本地盘存储时默认值为Stop。

NetworkAttributesSlbUdpTimeout

Integer

负载均衡连接的UDP会话超时时间。

取值范围:15~310。

单位:秒。

ResourceGroupId

String

专有宿主机要加入的资源组ID。

NetworkAttributesUdpTimeout

Integer

为专有宿主机上运行的云服务设置用户访问的UDP会话超时时间。

取值范围:15~310。

单位:秒。

Quantity

Integer

本次创建的专有宿主机的数量。

取值范围:1~100。

默认值:1。

Tags语法

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

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Key

String

标签键。

长度为1~128个字符,不能以aliyunacs:开头,不能包含http://或者https://

Value

String

标签值。

长度为0~128个字符,不能以aliyunacs:开头,不能包含http://或者https://

返回值

Fn::GetAtt

  • OrderId:订单ID。

  • DedicatedHostIds:主机ID列表。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Description: Test ECS DedicatedHost
Parameters:
  DedicatedHostType:
    Type: String
    Default: ddh.g6
  DedicatedHostName:
    Type: String
    Default: mytest
Resources:
  DedicatedHost:
    Type: ALIYUN::ECS::DedicatedHost
    Properties:
      DedicatedHostType:
        Ref: DedicatedHostType
      DedicatedHostName:
        Ref: DedicatedHostName
      ChargeType: PostPaid
Outputs:
  OrderId:
    Value:
      Fn::GetAtt:
        - DedicatedHost
        - OrderId
  DedicatedHostIds:
    Value:
      Fn::GetAtt:
        - DedicatedHost
        - DedicatedHostIds

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": "Test ECS DedicatedHost",
  "Parameters": {
    "DedicatedHostType": {
      "Type": "String",
      "Default": "ddh.g6"
    },
    "DedicatedHostName": {
      "Type": "String",
      "Default": "mytest"
    }
  },
  "Resources": {
    "DedicatedHost": {
      "Type": "ALIYUN::ECS::DedicatedHost",
      "Properties": {
        "DedicatedHostType": {
          "Ref": "DedicatedHostType"
        },
        "DedicatedHostName": {
          "Ref": "DedicatedHostName"
        },
        "ChargeType": "PostPaid"
      }
    }
  },
  "Outputs": {
    "OrderId": {
      "Value": {
        "Fn::GetAtt": [
          "DedicatedHost",
          "OrderId"
        ]
      }
    },
    "DedicatedHostIds": {
      "Value": {
        "Fn::GetAtt": [
          "DedicatedHost",
          "DedicatedHostIds"
        ]
      }
    }
  }
}