You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
proprietary host
ModifyInstancePlacement - Adjusts deployment settings for an instance on a DDH
Copy page
Download PDF
ModifyInstancePlacement - Adjusts deployment settings for an instance on a DDH
Call the ModifyInstancePlacement operation to adjust deployment settings for an instance on a dedicated host (DDH).​
Usage notes​
Before you call this operation, refer to the following topics to fully understand the limits and precautions to ensure accuracy and compliance.​
Request description​
When you call this operation, if you do not pass in optional parameters, the original configuration is retained.​
Debugging​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
Only the request parameters specific to this operation and some common parameters are listed below. For more information, please refer to Common parameters.​
Action string required Sample value: ModifyInstancePlacement​
The action that you want to perform. Value: ModifyInstancePlacement.​
​
Version string requiredSample value: 2020-04-01​
The API version. Valid value: 2020-04-01.​
​
Affinity string Optional Sample value: Host​
Whether the instance is associated with a DDH. Valid values:​
  • Host: Associates with a host. When the instance with Economical Mode enabled restarts, it will be deployed on the original host.​
  • Default: When the instance with Economical Mode enabled restarts, it will be preferentially migrated to a host that supports automatic deployment. If resources on the host that supports automatic deployment are insufficient, the instance restarts on the original host.​
​
ClientToken string Optional Sample value: 23fa21A8823nfasd7f****​
The ClientToken is used to ensure the request idempotency. You can use the client to automatically generate a token, but you must make sure that the token is unique among different requests. This prevents repeated actions due to multiple client retries when the call of the API operation times out or an internal server error occurs.​
Value: Only ASCII characters are supported. The length is no more than 64 ASCII characters.​
​
DedicatedHostId string Optional Sample value: dh-ycje2rquioh9l3bn****​
The ID of target DDH. You can call the DescribeDedicatedHosts operation to view available DDHs.​
  • To migrate the instance to a specified DDH, this parameter is required.​
  • To migrate the instance to a DDH in the auto-placement pool of the system, leave this parameter empty and set Tenancy to Host. For the automatic deployment feature, refer to Features.​
​
DryRun boolean Optional Sample value: false​
Whether to only precheck this request. Value:​
  • true: Sends a check request without relocating the instance to a different host. Check items include whether the required parameters are provided, the request format, business limits, and resource inventory. If the check fails, the corresponding error is returned. If the check passes, the error code DryRunOperation is returned.​
  • false (default): Sends a normal request. After the check is passed, the instance is immediately migrated to a new host.​
​
InstanceId string required Sample value: i-ycjls76kfam0tptz****​
ID of the instance to be migrated.​
​
InstanceTypeId string Optional Sample value: ecs.ddhr2s.define.c4m8​
Specifies the new instance type to which the instance will be changed.​
You can change the instance type when migrating the instance to a different host. The target instance type must match the specifications of the specified DDH.​
tip​
  • When MigrationType is set to ColdMigration, this parameter takes effect.​
  • To deploy the target instance on a DDH, specify the value of DedicatedHostId. To deploy the target instance on a shared host, you do not need to specify this parameter.​
​
MigrationType string Optional Sample value: ColdMigration​
Specifies the migration method for relocating the instance to a different host. Valid values:​
  • LiveMigration: Hot migration. The instance is migrated without being stopped and needs to be in the "Running" state.​
  • ColdMigration: Cold migration. The instance is migrated by stopping it first, and needs to be in the "Stopped" state. This method also allows you to change the instance type.​
​
Tenancy string Optional Sample value: Host​
Whether the instance is deployed on a DDH. Value:​
  • Host: When DedicatedHostId is not specified, the instance can be deployed in a DDH in the automatic deployment pool.​
  • Default: The instance can be deployed on a shared host.​
​
​
​
Response parameters​
This operation has no specific response parameters. For more information, refer to Response structure.​
Sample request​
​
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​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "202307171626144175A80ADCCEEBB8****",​
"Action": "ModifyInstancePlacement",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {}​
}​
​
Error codes​
The table below lists the business-related error codes of the operation. For more information, refer to Common error codes.​
​
Status code​
Error code​
Error message​
Description​
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.​
The idempotent parameters are inconsistent.​
400​
InvalidClientToken.Malformed​
The specified ClientToken is malformed.​
The specified ClientToken is invalid.​
400​
InvalidDedicatedHost​
The specified dedicated host does not support this request.​
The current DDH does not support this operation.​
400​
InvalidDedicatedHostForMigrate.Unsupported​
The specified dedicated host does not support migrate.​
The specified dedicated host does not support migration.​
400​
InvalidInstanceChargeTypeForModifyInstancePlacement.Unsupported​
The charge type of the specified instance cannot be used for ModifyInstancePlacement.​
The billing method of the specified instance does not support modifying host deployment.​
400​
InvalidInstanceStatus​
The status of the specified instance does not support this request.​
The current status of the instance does not support this operation.​
400​
InvalidInstanceTypeForLiveMigration.Unsupported​
The specified InstanceType does not support live migration.​
The specified instance type does not support hot migration.​
400​
InvalidPlacementAffinity.Malformed​
The specified placement affinity is malformed.​
The specified Placement.Affinity is invalid.​
400​
InvalidPlacementTenancy.Malformed​
The specified placement tenancy is malformed.​
The specified Placement.Tenancy is invalid.​
400​
InvalidStoppedModeForMigrateInstance.Unsupported​
The specified StoppedMode instance does not support migration.​
The specified instance with stopped billing does not support migration.​
400​
InvalidTenancyForModifyInstancePlacement.Unsupported​
The tenancy of the specified instance cannot be used for ModifyInstancePlacement.​
Tenancy of the specified instance does not support modifying host deployment.​
400​
LimitExceeded.MaximumVolumes​
You've reached the limit on the number of volumes that can be attached to the instance.​
The specified number of volumes mounted to the instance exceeds the upper limit.​
400​
MissingParameter.DedicatedHostId​
The required parameter DedicatedHostId is not supplied.​
The parameter DedicatedHostId cannot be empty.​
400​
MissingParameter.InstanceId​
The required parameter InstanceId is not supplied.​
The parameter InstanceId can not be left empty.​
400​
OperationDenied.InstanceUnSupportedLiveMigrationCurrently​
The specified instance does not currently support live migration.​
The specified instance currently does not support hot migration.​
404​
InvalidDedicatedHost.NotFound​
The specified dedicated host does not exist.​
The specified dedicated host does not exist.​
404​
InvalidInstance.NotFound​
The specified instance does not exist.​
The specified instance does not exist.​
404​
InvalidInstanceType.NotFound​
The specified InstanceType does not exist.​
The specified instance type does not exist.​
412​
DryRunOperation​
Your request has been validated by the DryRunOperation.​
Your request has been validated by "DryRun".​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
The previous idempotent request is still in process. Please try again later.​
500​
Insufficient.InstanceCapacity​
There is not enough capacity to fulfill your request.​
The resources are currently insufficient. Try again later or select other instance types.​
500​
InternalError​
An internal error has occurred.​
An internal error occurred. Try again. If multiple attempts fail, submit a ticket.​
​
Last updated: 2026.01.16 19:04:50