Restart an instance

Last Updated: Jul 25, 2017

Description

When restarting a specified instance, consider the following:

  • This operation is allowed only when the instance is in Running status.
  • After the interface is invoked successfully, the specified instance will be in Starting status.
  • An instance can be forcefully stopped. The force stop operation is same as power failure. Data in the instance operation system that is not written to the disk may be lost.
  • If OperationLocks of the instance indicates LockReason: security, the instance cannot be restarted.

Request parameters

Name Type Required Description
Action String Yes Value: RebootInstance.
InstanceId String Yes The specified instance ID.
ForceStop String No Whether to force shutdown upon device restart. Optional values:
  • true
  • false
If it is set to “false”, the system shuts down normally. If it is set to “true”, the system is forced to shut down.
If it is not specified, the default value is “false”.

Return parameters

All parameters are public return parameters. For details, refer to Public Return Parameters.

Error code

Error Code Description Http status code Meaning
InvalidInstanceId.NotFound The specified InstanceId does not exist. 404 The specified InstanceId does not exist.
MissingParameter The input parameter InstanceId that is mandatory for processing this request is not supplied. 400 InstanceId value is missing.
InvalidParameter The specified parameter ForceStop is not valid. 400 The specified ForceStop is invalid (not in the enumerated range).
IncorrectInstanceStatus The current status of the resource does not support this operation. 403 The current status of the resource does not support this operation.
InstanceLockedForSecurity The specified operation is denied as your instance is locked for security reasons. 403 The operation is denied because your instance is locked for security reasons.
DiskError IncorrectDiskStatus. 403 Abnormal disk status.

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=RebootInstance
  2. &InstanceId=i-instance1
  3. &<Public Request Parameters>

Return example

XML format

  1. <RebootInstanceResponse>
  2. <RequestId>F2E2C40D-AB09-45A1-B5C5-EB9F5C4E4E4A</RequestId>
  3. </RebootInstanceResponse>

JSON format

  1. {
  2. "RequestId": "F2E2C40D-AB09-45A1-B5C5-EB9F5C4E4E4A"
  3. }
Thank you! We've received your feedback.