All Products
Search
Document Center

Elastic Compute Service:RedeployInstance

Last Updated:Mar 19, 2024

Redeploys an Elastic Compute Service (ECS) instance when you receive an event notification for the instance.

Operation description

RedeployInstance is an asynchronous operation. This operation migrates data before it restarts the instance. After the instance is redeployed, the instance enters the Running state. If the instance fails to be redeployed, the instance returns to the original physical server and the state before redeployment.

Take note of the following items:

  • The instance must be in the Running or Stopped state. After the instance is redeployed, the following changes occur to the status of the instance:
    • If the instance is in the Running state before redeployment, the instance enters the Stopping state.
    • If the instance is in the Stopped state before redeployment, the instance enters the Starting state.
  • If an instance is deployed on a dedicated host, you cannot redeploy the instance.
  • If the OperationLocks parameter in the response of the DescribeInstances operation contains "LockReason" : "security" for an instance, the instance is locked for security reasons and cannot be redeployed.
  • If you receive notifications about simulated events that are created by calling the CreateSimulatedSystemEvent operation for an instance, you cannot redeploy the instance.
  • If the damaged local disk is isolated but the SystemMaintenance.RebootAndReInitErrorDisk event is not sent when you handle a local disk-related system event for an instance, you can still call the RedeployInstance operation to redeploy the instance. The SystemMaintenance.RebootAndReInitErrorDisk event indicates that the instance is restarted and the damaged disks are reinitialized due to system maintenance. For more information, see System events for ECS instances equipped with local disks.

The following table describes the system events that you can handle by calling the RedeployInstance operation. The table also provides possible event status.

System eventEvent status
Instance restart due to system maintenance (SystemMaintenance.Reboot)Inquiring and Scheduled
Instance redeployment due to system maintenance (SystemMaintenance.Redeploy)Inquiring and Scheduled
Instance restart and replacement of damaged disks due to system maintenance (SystemMaintenance.RebootAndIsolateErrorDisk)Inquiring
Instance restart and re-initialization of damaged disks due to system maintenance (SystemMaintenance.RebootAndReInitErrorDisk)Inquiring
Instance redeployment due to system errors (SystemFailure.Redeploy)Inquiring and Scheduled
For ECS instances that use only local disks: instance restart due to a system error (SystemFailure.Reboot)Executing
Isolation of damaged disks due to system maintenance (SystemMaintenance.IsolateErrorDisk)Inquiring
Re-initialization of damaged disks due to system maintenance (SystemMaintenance.ReInitErrorDisk)Inquiring

NoteWhen instances that use local disks are redeployed, the local disks are re-initialized and data on the local disks is cleared.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the instance.

i-bp1azkttqpldxgted****
ForceStopbooleanNo

Specifies whether to forcefully stop the instance that is in the Running state.

Default value: false.

Note A forced stop is equivalent to a power outage, and unsaved data may be lost. We recommend that you redeploy instances that are in the Stopped state.
false

Response parameters

ParameterTypeDescriptionExample
object
TaskIdstring

The ID of the redeployment task.

You can call the DescribeTasks operation to query the redeployment result.

t-bp10e8orkp8x****
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Examples

Sample success responses

JSONformat

{
  "TaskId": "t-bp10e8orkp8x****",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

HTTP status codeError codeError messageDescription
403IncorrectInstanceStatusThe current status of the resource does not support this operation.The resource is in a state that does not support the current operation.
403InstanceLockedForSecurityThe specified operation is denied as your instance is locked for security reasons.-
403DiskErrorIncorrectDiskStatus.The disk state is invalid.
403InstanceExpiredOrInArrearsThe specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).The subscription instance has expired. You must renew the instance before you can proceed.
403IncorrectInstanceStatus%sThe instance is in a state that does not support the current operation.
403InvalidOperation.RedeployInstance%sThe operation is invalid.
404InvalidInstanceId.NotFoundThe InstanceId provided does not exist in our records.The specified instance does not exist. Check whether the instance ID is correct.
500InternalErrorThe request processing has failed due to some unknown error.An internal error has occurred. Try again later.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history