【问题标题】:AWS: What happens when I send start command to already started instance?AWS:当我向已经启动的实例发送启动命令时会发生什么?
【发布时间】:2017-04-24 18:46:38
【问题描述】:

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

$ 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
发生错误 奇怪的是,我没有创建新实例——所有实例都已经在运行了。
停止所有实例后,启动和以前一样。

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

【问题讨论】:

  • 好像有实例和实例类型限制。例如。 d2.8xlarge 限制为 5 个实例,如果需要更多,需要增加限制 aws.amazon.com/ec2/faqs/…

标签: amazon-web-services amazon-ec2


【解决方案1】:

为已运行的实例发送StartInstances 命令不会产生错误。它只是返回如下响应:

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

因此,当您启动 Running 实例时,什么都不会发生。

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

【讨论】:

    猜你喜欢
    • 2010-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-05
    • 1970-01-01
    • 2019-09-25
    相关资源
    最近更新 更多