Amazon EC2 自动缩放实例始终将状态显示为 "pending"

Amazon EC2 autoscaling instances always show status as "pending"

我使用面向 Amazon ECS 的 AMI 创建了启动配置。所有实例都连接到 VPC,但也有一个 public 非 EIP 地址。

当我创建自动缩放组时,我可以查看“实例”页面并查看实例通过了所有健康检查。

此外,我创建的 ELB 会选择新实例并开始为它们提供流量。

但是,自动缩放器总是将我的实例显示为 "pending" 并最终销毁它们。

这是怎么回事?

实例:

ELB:

自动缩放显示实例挂起:

感谢您的帮助!

编辑

这是启动日志的输出,其中包含一条非常无用的消息:

从 Auto Scaling 组模块检查您的 ASG Activity 历史选项卡,特别检查从 Scale OutPending、到 Terminated 的过渡。

对于其中的每一个,选中将显示以下字段的 'more' 箭头:

  • 描述: Launching a new EC2 instance: i-0aaaaa06b45ce05
  • 原因: At 2016-06-16T17:54:25Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 2 to 4

activity 历史和相关的生命周期事件描述和原因将帮助您快速缩小问题范围。

Terminated/Cancelled 事件的起因将受到特别关注。这是 Terminated 事件的示例:

  • 描述: Terminating EC2 instance: i-0aaaaaad47162b8f84
  • 原因: At 2016-05-20T08:12:42Z an instance was taken out of service in response to a EC2 instance status checks failure.

编辑:

根据提供的日志历史记录,实例因 Only EC2-Classic instances may be linked. 错误而无法启动。启动配置中存在配置问题。

检查您的启动配置,并确保在高级详细信息中取消选中 Link 到 VPC 选项。