You need to enable JavaScript to run this app.
导航

ModifyInstancePlacement

最近更新时间2024.04.22 16:49:57

首次发布时间2024.04.22 11:34:50

调用 ModifyInstancePlacement 接口在专有宿主机之间迁移实例。

请求说明

  • 目标专有宿主机与待迁移的实例属于同一账号、同一地域和可用区。
  • 待迁移的实例需处于“已停止”状态,请先调用StopInstances接口停止实例。
  • 调用该接口时,如不传入可选参数,则保持原有配置。

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
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接口查看可以使用的专有宿主机。

  • 若将实例迁移至指定专有宿主机上,必须传入该参数。
  • 若将实例迁移至系统自动部署资源池中的专有宿主机上,必须将该参数设置为空,并设置Affinity为Host。自动部署功能请参见功能特性
  • 若将实例迁移至指定专有宿主机上,必须传入该参数。
  • 若将实例迁移至系统自动部署资源池中的专有宿主机上,必须将该参数设置为空。自动部署功能请参见功能特性
InstanceId
String

i-ycjls76kfam0tptz****

待迁移的实例ID。

返回参数

本接口无特有的返回参数。更多信息请见返回结构

请求示例

GET /?Action=ModifyInstancePlacement&Version=2020-04-01&DedicatedHostId=dh-ycje2rquioh9l3bn****&InstanceId=i-ycjls76kfam0tptz**** HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
Service: ecs

返回示例

{
    "ResponseMetadata": {
        "RequestId": "202307171626144175A80ADCCEEBB8****",
        "Action": "ModifyInstancePlacement",
        "Version": "2020-04-01",
        "Service": "ecs",
        "Region": "cn-beijing"
    },
    "Result": {}
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
MissingParameter.AccountId
The required parameter AccountId is not supplied.

账户ID不能为空。

400
MissingParameter.InstanceId
The required parameter InstanceId is not supplied.

实例ID不能为空。

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
InvalidStoppedModeForMigrateInstance.Unsupported
The specified StoppedMode instance does not support migration.

指定的停止计费实例不支持迁移。

400
InvalidPlacementAffinity.Malformed
The specified placement affinity is malformed.

指定的Placement.Affinity不合法。

400
InvalidInstanceTypeForLiveMigration.Unsupported
The specified InstanceType does not support live migration.

指定的实例的规格不支持热迁移。

400
InvalidInstanceStatus
The status of the specified instance does not support this request.

当前实例的状态不支持此操作。

400
InvalidDedicatedHostForMigrate.Unsupported
The specified dedicated host does not support migrate.

指定的专有物理机不支持迁移操作。

400
InvalidDedicatedHost
The specified dedicated host does not support this request.

当前专有宿主机不支持此操作。

400
InvalidClientToken.Malformed
The specified ClientToken is malformed.

指定的ClientToken不合法。

404
InvalidInstanceType.NotFound
The specified InstanceType does not exist.

指定的实例规格不存在。

404
InvalidInstance.NotFound
The specified instance does not exist.

指定的实例不存在。

404
InvalidDedicatedHost.NotFound
The specified dedicated host does not exist.

指定的专有宿主机不存在。

404
InvalidActionOrVersion
Could not find operation %s for version %s.

请求接口不存在。

412
IdempotentProcessing
The request uses the same client token as a previous one that is still in process.

先前的幂等请求仍在处理中,请稍后重试。

500
InternalError
An internal error has occurred.

内部错误,请重试。如果多次尝试失败,请提交工单。

500
Insufficient.InstanceCapacity
There is not enough capacity to fulfill your request.

当前资源不足,请稍后重试或选择其它实例规格。