Redeploys an instance when the instance receives a system event notification.
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 theStopping
state. - If the instance is in the
Stopped
state before redeployment, the instance enters theStarting
state.
- If the instance is in the
- 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 event | Event 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
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ecs:RedeployInstance | update | *Instance acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The ID of the instance. | i-bp1azkttqpldxgted**** |
ForceStop | boolean | No | 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
Examples
Sample success responses
JSON
format
{
"TaskId": "t-bp10e8orkp8x****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | The resource is in a state that does not support the current operation. |
403 | InstanceLockedForSecurity | The specified operation is denied as your instance is locked for security reasons. | - |
403 | DiskError | IncorrectDiskStatus. | The disk state is invalid. |
403 | InstanceExpiredOrInArrears | The 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. |
403 | IncorrectInstanceStatus | %s | The instance is in a state that does not support the current operation. |
403 | InvalidOperation.RedeployInstance | %s | The operation is invalid. |
404 | InvalidInstanceId.NotFound | The InstanceId provided does not exist in our records. | The specified instance does not exist. Check whether the instance ID is correct. |
500 | InternalError | The 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 time | Summary of changes | Operation |
---|