本接口用于启动一台ECS实例,您可以通过指定实例ID以及按需设置 InitLocalDisk 等参数启动实例。
接口说明
该接口为异步接口,实例的启动不是立即完成的,成功调用后,实例会先进入启动中(Starting)状态,你可以调用 DescribeInstanceStatus 查看实例状态,当返回的状态为Running时代表启动成功。
使用须知
被安全锁定的实例不能通过调用该接口启动。更多信息,请参见资源安全锁定对调用 API 的影响。
ECS 实例状态必须为已停止(
Stopped)。节省停机模式下可能会因为库存不足导致启动失败。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ecs:StartInstance |
update |
*Instance
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| InstanceId |
string |
是 |
指定启动的实例 ID。 |
i-bp67acfmxazb4p**** |
| InitLocalDisk |
boolean |
否 |
当本地盘出现故障时,可通过此参数指定启动实例时,是否将实例恢复到最初的健康状态。适用于实例规格族 d1、i1 或者 i2 等包含本地盘的实例。取值范围:
默认值为 false。 |
true |
| DryRun |
boolean |
否 |
是否只预检查此次请求。取值范围:
默认值为 false。 |
true |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
示例
正常返回示例
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
异常返回示例
JSON格式
{
"RequestId": "C0003E8B-B930-4F59-ADC0-0E20xxxxxxxx"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | LackResource | There's no enough resource on the specified capacity reservation. | |
| 400 | InvalidDedicatedHost.NotEnoughResource | The specified dedicated host has not enough resource due to host affinity. | |
| 400 | InvalidInstance.NotFoundSystemDisk | The specified instance does not have system disk. | |
| 400 | Invalid.PrivatePoolOptions.NoStock | The PrivatePool has been used up. | 指定的私有池(弹性保障、资源预定)容量已经使用完。 |
| 500 | InstanceNotReady | The specified instance is not ready for use. | |
| 500 | InternalError | The request processing has failed due to an internal error and you may retry later or contact support with the request ID. | |
| 403 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. | |
| 403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | InstanceLockedForSecurity | The specified operation is denied as your instance is locked for security reasons. | 实例被安全锁定。 |
| 403 | InsufficientBalance | Your account does not have enough balance. | |
| 403 | DiskError | IncorrectDiskStatus. | |
| 403 | InstanceExpired | The postPaid instance has been expired.Please ensure your account have enough balance. | 按量付费的实例已过期。请确保您的阿里云账号有足够的余额。 |
| 403 | InstanceNotReady | The specified instance is not ready for use. | |
| 403 | DiskInArrears | The specified operation is denied as your disk has expired. | |
| 403 | OperationDenied.SpotPriceLowerThanPublicPrice | The spot instance price is lower than public price. | 抢占式实例的竞价价格不能低于公开的价格。 |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK needs to be added ECS tag. | CMK 未授权 |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK needs to be enabled. | |
| 403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service have no right to access your KMS. | ECS 服务无权访问您的 KMS。 |
| 403 | QuotaExceed.ElasticQuota | No additional quota is available for the specified ECS instance type. | 您在当前地域选择的实例规格所要创建的台数超出系统限额,您可以选择其他地域、实例规格或减少台数重新购买,也可以前往ECS管理控制台或配额中心申请提高限额。 |
| 403 | OperationDenied.HostRepairing | The specified operation is denied as the host of ECS instance is being repaired. | ECS实例所在物理机正在维修中不允许执行指定操作。 |
| 403 | OperationDenied.NoStock | The requested resource is sold out in the specified zone, try other types of resources or other regions and zones. | 请求的资源在指定的可用区已售罄,请您更换实例规格或者可用区重试。 |
| 403 | OperationDenied.KMSKeyUnauthorized | The operation is denied due to missing KMS key authorization. Please check the KMS key permissions and ensure the key is properly authorized for this operation. | |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的实例ID无效。 |
| 404 | InvalidCapacityReservationId.NotFound | The specified capacity reservation does not exist. | |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | 请求后端超时,请稍后重试。 |
| 503 | LimitedOperation.ServiceUnavailable | The service is currently unavailable. Please try again later. | 当前服务不可用。请稍后重试。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。