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

云服务器

复制全文
下载 pdf
专有宿主机
ModifyInstancePlacement - 专有宿主机上的实例调整部署设置
复制全文
下载 pdf
ModifyInstancePlacement - 专有宿主机上的实例调整部署设置
调用 ModifyInstancePlacement 接口为专有宿主机上的实例调整部署设置。​
使用说明​
调用该接口前,请先阅读以下文档,充分了解其中的约束限制和注意事项,以确保操作的准确性和合规性。​
请求说明​
调用该接口时,如不传入可选参数,则保持原有配置。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:ModifyInstancePlacement​
要执行的操作,取值:ModifyInstancePlacement。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
Affinity string 可选 示例值:Host​
实例是否关联专有宿主机,取值:​
  • Host:关联宿主机。启用节省停机模式的实例重新启动时,仍会部署在原宿主机上。​
  • Default(默认):启用节省停机模式的实例重新启动时,会优先迁移到支持自动部署的宿主机;若支持自动部署的宿主机资源不足,则在原宿主机上进行启动。​
​
ClientToken string 可选 示例值:23fa21A8823nfasd7f****​
保证请求幂等性。由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
取值:仅支持ASCII字符,且不能超过64个字符。​
​
DedicatedHostId string 可选 示例值:dh-ycje2rquioh9l3bn****​
目标专有宿主机ID,可以调用DescribeDedicatedHosts接口查看可以使用的专有宿主机。​
  • 若将实例迁移至指定专有宿主机上,必须传入该参数。​
  • 若将实例迁移至系统自动部署资源池中的专有宿主机上,必须将该参数设置为空,并设置Tenancy为Host。自动部署功能请参见功能特性。​
​
DryRun boolean 可选 示例值:false​
是否只预检此次请求。取值:​
  • true:发送检查请求,不会调整实例的宿主机部署。检查项包括是否填写了必需参数、请求格式、业务限制和资源库存。如果检查不通过,则返回对应错误。如果检查通过,则返回错误码DryRunOperation。​
  • false(默认):发送正常请求,通过检查后直接调整宿主机部署。​
​
InstanceId string 必选 示例值:i-ycjls76kfam0tptz****​
待迁移的实例ID。​
​
InstanceTypeId string 可选 示例值:ecs.ddhr2s.define.c4m8​
指定要变更的目标实例规格。​
调整实例宿主机时,可同时变更实例规格。目标规格必须与指定专有宿主机的规格相匹配。​
说明​
  • 当MigrationType取值为ColdMigration,该参数生效。​
  • 如果希望变更后的实例部署在DDH上,必须指定DedicatedHostId的值。如果希望变更后的实例位于共享宿主机则不需要指定。​
​
MigrationType string 可选 示例值:ColdMigration​
指定调整宿主机部署的实例迁移方式,取值:​
  • LiveMigration:热迁移,即不停机迁移,待迁移的实例需处于“运行中”状态。​
  • ColdMigration:冷迁移,即停机迁移,待迁移的实例需处于“已停止”。同时支持更改实例规格。​
​
Tenancy string 可选 示例值:Host​
实例是否在专有宿主机上部署。取值:​
  • Host:DedicatedHostId不传时,支持实例在自动部署池中部署。​
  • Default:支持实例在共享宿主机上部署。​
​
​
​
返回参数​
本接口无特有的返回参数。更多信息请见返回结构。​
请求示例​
​
GET /?Action=ModifyInstancePlacement&Version=2020-04-01&DedicatedHostId=dh-ycje2rquioh9l3bn****&InstanceId=i-ycjls76kfam0tptz**** HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
Service: ecs​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "202307171626144175A80ADCCEEBB8****",​
"Action": "ModifyInstancePlacement",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
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​
InvalidClientToken.Malformed​
The specified ClientToken is malformed.​
指定的ClientToken不合法。​
400​
InvalidDedicatedHost​
The specified dedicated host does not support this request.​
当前专有宿主机不支持此操作。​
400​
InvalidDedicatedHostForMigrate.Unsupported​
The specified dedicated host does not support migrate.​
指定的专有物理机不支持迁移操作。​
400​
InvalidInstanceChargeTypeForModifyInstancePlacement.Unsupported​
The charge type of the specified instance cannot be used for ModifyInstancePlacement.​
指定的实例的计费类型不支持调整宿主机部署。​
400​
InvalidInstanceStatus​
The status of the specified instance does not support this request.​
当前实例的状态不支持此操作。​
400​
InvalidInstanceTypeForLiveMigration.Unsupported​
The specified InstanceType does not support live migration.​
指定的实例的规格不支持热迁移。​
400​
InvalidPlacementAffinity.Malformed​
The specified placement affinity is malformed.​
指定的Placement.Affinity不合法。​
400​
InvalidPlacementTenancy.Malformed​
The specified placement tenancy is malformed.​
指定的Placement.Tenancy不合法。​
400​
InvalidStoppedModeForMigrateInstance.Unsupported​
The specified StoppedMode instance does not support migration.​
指定的停止计费实例不支持迁移。​
400​
InvalidTenancyForModifyInstancePlacement.Unsupported​
The tenancy of the specified instance cannot be used for ModifyInstancePlacement.​
指定的实例的Tenancy不支持调整宿主机部署。​
400​
LimitExceeded.MaximumVolumes​
You've reached the limit on the number of volumes that can be attached to the instance.​
指定的实例挂载云盘数量超过最大限制。​
400​
MissingParameter.DedicatedHostId​
The required parameter DedicatedHostId is not supplied.​
参数DedicatedHostId不能为空。​
400​
MissingParameter.InstanceId​
The required parameter InstanceId is not supplied.​
参数实例ID不能为空。​
400​
OperationDenied.InstanceUnSupportedLiveMigrationCurrently​
The specified instance does not currently support live migration.​
指定的实例当前不支持热迁移。​
404​
InvalidDedicatedHost.NotFound​
The specified dedicated host does not exist.​
指定的专有宿主机不存在。​
404​
InvalidInstance.NotFound​
The specified instance does not exist.​
指定的实例不存在。​
404​
InvalidInstanceType.NotFound​
The specified InstanceType 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.InstanceCapacity​
There is not enough capacity to fulfill your request.​
当前资源不足,请稍后重试或选择其它实例规格。​
500​
InternalError​
An internal error has occurred.​
内部错误,请重试。如果多次尝试失败,请提交工单。​
​
​
最近更新时间:2025.09.04 16:59:42
这个页面对您有帮助吗?
有用
有用
无用
无用