卓:当我向已经启动的实例发送启动命令时会发生什么? [英] AWS: What happens when I send start command to already started instance?

查看:122
本文介绍了卓:当我向已经启动的实例发送启动命令时会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有10台计算机的AWS实例限制. 我有5个跑步. 我可以启动已经启动的机器:

I have AWS instance limit for 10 machines. I have 5 running. I can start already started machine:

$ aws ec2 start-instances --instance-ids i-123456789
---------------------------
|     StartInstances      |
+-------------------------+
||   StartingInstances   ||
|+-----------------------+|
||      InstanceId       ||
|+-----------------------+|
||  i-123456789          ||
|+-----------------------+|
|||    CurrentState     |||
||+--------+------------+||
|||  Code  |   Name     |||
||+--------+------------+||
|||  16    |  running   |||
||+--------+------------+||
|||    PreviousState    |||
||+--------+------------+||
|||  Code  |   Name     |||
||+--------+------------+||
|||  16    |  running   |||
||+--------+------------+||

当我几次启动5台启动机器时,我收到消息:发生错误(InstanceLimitExceeded) when calling the StartInstances operation: Your quota allows for 0 more running instance(s). You requested at least 1
奇怪的是,因为我不创建新实例-所有实例都已在运行.
停止所有实例后,启动可以像以前一样工作.

And when I do start to 5 started machines couple times suddenly I get the message:An error occurred (InstanceLimitExceeded) when calling the StartInstances operation: Your quota allows for 0 more running instance(s). You requested at least 1
What is strange because I don't create new instances - all are running already.
After stopping all instances, starting works as before.

当我启动已经启动的机器时会发生什么?

What is happening then when I starting already started machines?

推荐答案

为已经运行的实例发送StartInstances命令不会产生错误.它只是返回一个响应,如:

Sending a StartInstances command for an instance that is already running does not generate an error. It simply returns a response like:

{
    "StartingInstances": [
        {
            "InstanceId": "i-abcd1234", 
            "CurrentState": {
                "Code": 16, 
                "Name": "running"
            }, 
            "PreviousState": {
                "Code": 16, 
                "Name": "running"
            }
        }
    ]
}

因此,启动正在运行的实例时没有任何反应.

So, nothing is happening when you start a Running instance.

那么,您可能想知道为什么它会给您错误消息.我不知道,但是我怀疑检查配额以确定您是否可以启动实例的逻辑是否不首先检查所请求的实例是否正在运行.它可能会查看当前正在运行的实例数,添加您希望启动的实例数,如果总数超过允许的配额,则会生成错误.

You are probably wondering, then, why it gave you the error message. I do not know, but I suspect that the logic that checks quotas to determine whether you can start an instance does not first check whether the requested instances are running. It probably looks at the current number of instances running, adds the number of instances you wish to start and then generates an error if total exceeds the permitted quota.

这篇关于卓:当我向已经启动的实例发送启动命令时会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆