You need to enable JavaScript to run this app.
文档中心
云服务器

云服务器

复制全文
下载 pdf
专有宿主机
AllocateDedicatedHosts - 申请专有宿主机
复制全文
下载 pdf
AllocateDedicatedHosts - 申请专有宿主机
调用 AllocateDedicatedHosts 接口申请一台或多台包年包月的专有宿主机。​
使用说明​
  • 创建专有宿主机会产生费用,建议您提前了解资源的计费方式,具体请参见DDH及其实例计费。​
  • 创建专有宿主机后,您可以调用RunInstances接口,在专有宿主机上创建一台或多台ECS实例,用于部署业务,独占物理资源。​
  • 您还可以调用ModifyInstancePlacement接口,将ECS实例从共享宿主机迁移到专有宿主机,也可以在两台专有宿主机上调整实例部署。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:AllocateDedicatedHosts​
要执行的操作,取值:AllocateDedicatedHosts。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
AutoPlacement string 可选 示例值:Off​
专有宿主机是否加入自动部署资源池,取值:​
  • On:加入自动部署资源池。创建实例时可以不指定DDH,由系统从自动部署池中选择合适的DDH部署实例。​
  • Off(默认):不加入自动部署资源池。您需自行在DDH上部署实例,即创建实例时指定DDH。​
创建实例操作请参见RunInstances。​
​
AutoRenew boolean 可选 示例值:true​
专有宿主机到期后是否自动续费。​
  • true:自动续费。​
  • false(默认):不自动续费。​
​
AutoRenewPeriod integer 可选 示例值:1​
每次自动续费的时长。​
  • 当参数AutoRenew取值为True时,该参数有效。​
  • PeriodUnit取值为Month时,AutoRenewPeriod取值为1、2、3、6、12,默认值为1。​
​
ChargeType string 可选 示例值:PostPaid​
专有宿主机的计费类型,取值:​
PrePaid:包年包月。​
​
ClientToken string 可选 示例值:333456899ff****​
保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
取值:仅支持ASCII字符,且不能超过64个字符。​
​
Count integer 可选 示例值:1​
创建数量,取值范围:1~100。​
传入0时,会默认为1。​
​
CpuOvercommitRatio double 可选 示例值:4​
CPU超分比,用于提升DDH的可用vCPU数。一台DDH的可用vCPU数 = 物理CPU核数 * 2 * CPU超分比。​
  • 取值范围:1~4。​
  • 默认值:支持配置的最大超分倍数。​
​
DedicatedHostClusterId string 可选 示例值:dc-ycle6b76kgv2wrsm****​
专有宿主机集群ID。​
您可以调用DescribeDedicatedHostClusters查询专有宿主机集群。​
​
DedicatedHostName string 必选 示例值:dedicated-host-test​
专有宿主机的名称。​
  • 不能以数字、下划线“_”、中划线“-”开头。​
  • 只能包含中文、字母、数字、下划线“_”和中划线“-”。​
  • 长度限制为1~128个字符。​
  • 暂不支持特殊字符。​
​
DedicatedHostRecovery string 可选 示例值:On​
专有宿主机处于临时不可用(TempUnavailable)状态时,是否开启宕机自动迁移,取值:​
  • On:开启宕机自动迁移。开启后,宿主机宕机时会自动迁移至健康的DDH。​
  • Off(默认):不开启宕机自动迁移。可以调用RedeployDedicatedHost手动更换物理机。​
​
DedicatedHostTypeId string 必选 示例值:ecs.ddhr2s​
专有宿主机规格。​
可以通过DescribeDedicatedHostTypes接口获取。​
​
Description string 可选 示例值:用于测试的专有宿主机​
专有宿主机的描述,默认值为空字符串。​
  • 必须以字母或中文开头。​
  • 只能包含中文、字母、数字、点“.”、空格、下划线“_”、中划线“-”、等号“=”、英文逗号“,”、中文逗号“,”和中文句号“。”​
  • 长度限制在255个字符以内。​
​
DryRun boolean 可选 示例值:false​
是否只预检此次请求。取值:​
  • true:发送检查请求,不会创建专有宿主机。检查项包括是否填写了必需参数、请求格式、业务限制和资源库存。如果检查不通过,则返回对应错误。如果检查通过,则返回错误码DryRunOperation。​
说明​
当DryRun取值为true时,若传入了Count参数,则取值必须为1。​
  • false(默认):发送正常请求,通过检查后直接创建专有宿主机。​
​
Period integer 可选 示例值:12​
购买资源的时长(月)。​
取值:1、2、3、4、5、6、7、8、9、12、24、36​
​
PeriodUnit string 可选 示例值:Month​
购买资源的时长单位。​
取值:Month​
​
ZoneId string 必选 示例值:cn-beijing-a​
专有宿主机所在可用区ID。​
您可以调用DescribeZones查询一个地域下的可用区信息。​
​
​
​
返回参数​
下表仅列出本接口特有的返回参数。更多信息请参见返回结构。​
DedicatedHostIds string[] 示例值:[dh-3tigy72q3u3vj0x2**** ]​
专有宿主机ID。​
​
​
​
请求示例​
​
GET /?Action=AllocateDedicatedHosts&Version=2020-04-01&ZoneId=cn-beijing-a&DedicatedHostTypeId=ecs.ddhr2s&DedicatedHostName=dedicated-host&Count=1&ChargeType=PrePaid&Period=1&PeriodUnit=Month HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
Service: ecs​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "202307141717540EC59BF6CDCC7C44****",​
"Action": "AllocateDedicatedHosts",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {​
"DedicatedHostIds": [​
"dh-3tigy72q3u3vj0x2****"​
]​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
IdempotentParameterMismatch​
The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.​
幂等参数不一致。​
400​
Insufficient.Balance​
The request is denied due to the lack of balance.​
账户余额不足。​
400​
InvalidArgument​
The specified argument is invalid.​
指定的参数不合法。​
400​
InvalidAutoPlacement.Malformed​
The specified AutoPlacement is malformed.​
指定的AutoPlacement不合法。​
400​
InvalidChargeType.Malformed​
The specified ChargeType is malformed.​
指定的计费类型不合法。​
400​
InvalidClientToken.Malformed​
The specified ClientToken is malformed.​
指定的ClientToken不合法。​
400​
InvalidCount.Malformed​
The specified count is malformed.​
指定的参数Count不合法。​
400​
InvalidCpuOvercommitRatio.Malformed​
The specified CpuOvercommitRatio is malformed.​
指定的超分比不合法。​
400​
InvalidDedicatedHostName.Malformed​
The specified DedicatedHostName is malformed.​
指定的DedicatedHostName不合法。​
400​
InvalidDedicatedHostRecovery.Malformed​
The specified DedicatedHostRecovery is malformed.​
指定的DedicatedHostRecovery不合法。​
400​
InvalidDescription.Malformed​
The specified Description is malformed.​
指定的描述不合法。​
400​
InvalidPeriod.Malformed​
The specified period is malformed.​
指定的计费周期不合法。​
400​
InvalidPeriodUnit.Malformed​
The specified PeriodUnit is malformed.​
指定的计费周期不合法。​
400​
MissingParameter.DedicatedHostName​
The required parameter DedicatedHostName is not supplied.​
参数DedicatedHostName不能为空。​
400​
MissingParameter.DedicatedHostTypeId​
The required parameter DedicatedHostTypeId is not supplied.​
参数DedicatedHostTypeId不能为空。​
400​
MissingParameter.ZoneId​
The required parameter ZoneId is not supplied.​
可用区ID不能为空。​
400​
QuotaExceeded.MaximumDedicatedHosts​
You've reached the limit on the number of dedicated hosts that you can allocate, please submit ticket to request an increase in quota.​
专有宿主机规格数量配额不足,请提工单申请提高配额。​
400​
QuotaExceeded.MaximumGeneralCpus​
You've reached the limit on the number of general instances CPU that you can create, please submit ticket or sign-on to the Console to request an increase in [general_vcpu] quota.​
通用型实例CPU数量配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumGpuBasicNums​
You've reached the limit on the GPU number of GPU-accelerated instances that you can create, please submit ticket or sign-on to the Console to request an increase in [gpu_basic] quota.​
GPU计算型实例卡数配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumHighPerformanceGpus​
You've reached the limit on the GPU number of High Performance Computing GPU instances that you can create, please submit ticket or sign-on to the Console to request an increase in [gpu_high_performance] quota.​
高性能计算GPU型实例卡数配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumLocalVolumeCpus​
You've reached the limit on the number of local volume instances CPU that you can create, please submit ticket or sign-on to the Console to request an increase in [local_volume_vcpu] quota.​
本地盘实例CPU数量配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumReservedInstanceGeneralCpus​
You've reached the limit on the number of general reserved instances CPU that you can create, please submit ticket or sign-on to the Console to request an increase in [general_vcpu_ri_regional] quota.​
通用型实例地域级RI CPU数量配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumReservedInstanceGpuBasicNums​
You've reached the limit on the GPU number of GPU-accelerated reserved instances that you can create, please submit ticket or sign-on to the Console to request an increase in [gpu_basic_ri_regional] quota.​
GPU计算型实例地域级RI卡数配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumReservedInstanceHighPerformanceGpus​
You've reached the limit on the GPU number of High Performance Computing GPU reserved instances that you can create, please submit ticket or sign-on to the Console to request an increase in [gpu_high_performance_ri_regional] quota.​
高性能计算GPU型实例地域级RI卡数配额不足,请提工单或前往控制台申请提高配额。​
400​
QuotaExceeded.MaximumReservedInstanceLocalVolumeCpus​
You've reached the limit on the number of local volume reserved instances CPU that you can create, please submit ticket or sign-on to the Console to request an increase in [local_volume_vcpu_ri_regional] quota.​
本地盘实例地域级RI CPU数量配额不足,请提工单或前往控制台申请提高配额。​
404​
InvalidDedicatedHostCluster.NotFound​
The specified dedicated host cluster does not exist.​
指定的专有宿主机集群不存在。​
404​
InvalidDedicatedHostType.NotFound​
The specified DedicatedHostTypeId does not exist.​
指定的专有宿主机规格不存在。​
404​
InvalidZone.NotFound​
The specified zone does not exist.​
指定的可用区不存在。​
412​
DryRunOperation​
Your request has been validated by the DryRunOperation.​
通过“DryRun”校验,您的请求已通过验证。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
先前的幂等请求仍在处理中,请稍后重试。​
500​
Insufficient.DedicatedHostCapacity​
There is not enough capacity to fulfill your request.​
当前资源不足,请稍后重试或选择其它专有宿主机规格。​
500​
InternalError​
An internal error has occurred.​
内部错误,请重试。如果多次尝试失败,请提交工单。​
​
​
最近更新时间:2025.09.04 16:59:42
这个页面对您有帮助吗?
有用
有用
无用
无用