AWS Auto Scaling 启动失败阻止启动新实例

AWS Auto Scaling launch failure preventing new instances from being launched

我最近创建了这个 ASG 并对其进行了设置和工作,但我需要对正在使用的 AMI 进行一些修改。我分离了当前属于 ASG 的一个实例,从那时起这些问题就开始发生了。

我已尝试将实例重新附加到 ASG,这有效,但新实例仍然无法启动。

activity 控制台没有告诉我启动失败的原因,它会一直这样做,直到我将 ASG 中的所需实例设置为 0。

这是 activity 日志:

Successful  Terminating EC2 instance: i-072a7a11dadcba031   At 2022-03-11T13:29:01Z an instance was taken out of service in response to a launch failure.   2022 March 11, 08:29:01 AM -05:00   2022 March 11, 08:30:25 AM -05:00

Cancelled   Launching a new EC2 instance: i-072a7a11dadcba031. Status Reason: Instance failed to complete user's Lifecycle Action: Lifecycle Action with token c8eb31cb-4648-4390-93a6-e049033f3ba4 was abandoned: Lifecycle Action Completed with ABANDON Result   At 2022-03-11T13:27:37Z a user request update of AutoScalingGroup constraints to min: 1, max: 4, desired: 1 changing the desired capacity from 0 to 1. At 2022-03-11T13:27:46Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.    2022 March 11, 08:27:48 AM -05:00   2022 March 11, 08:29:01 AM -05:00

Successful  Terminating EC2 instance: i-0ca1b9a7e42966793   At 2022-03-11T13:21:54Z an instance was taken out of service in response to a launch failure.   2022 March 11, 08:21:54 AM -05:00   2022 March 11, 08:23:16 AM -05:00

Cancelled   Launching a new EC2 instance: i-0ca1b9a7e42966793. Status Reason: Instance failed to complete user's Lifecycle Action: Lifecycle Action with token 088d4fc9-7e01-41e2-bb9d-df4485d488ea was abandoned: Lifecycle Action Completed with ABANDON Result   At 2022-03-11T13:20:53Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.   2022 March 11, 08:20:55 AM -05:00   2022 March 11, 08:21:54 AM -05:00

Successful  Terminating EC2 instance: i-06695e836f4cdbd5b   At 2022-03-11T12:53:53Z an instance was taken out of service in response to a launch failure.   2022 March 11, 07:53:53 AM -05:00   2022 March 11, 07:55:17 AM -05:00

Cancelled   Launching a new EC2 instance: i-06695e836f4cdbd5b. Status Reason: Instance failed to complete user's Lifecycle Action: Lifecycle Action with token b985e810-9dbc-4f37-a70e-d6eb90a85f51 was abandoned: Lifecycle Action Completed with ABANDON Result   At 2022-03-11T12:52:39Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.   2022 March 11, 07:52:41 AM -05:00   2022 March 11, 07:53:53 AM -05:00

我该如何解决这个问题?

它似乎与 AMI 本身无关,因为我可以启动一个不属于 ASG 的实例并且它运行没有任何问题。

Auto Scaling 组似乎已配置为使用 Amazon EC2 Auto Scaling lifecycle hooks - Amazon EC2 Auto Scaling

这是启动新实例并将通知发送到生命周期挂钩的地方。 Auto Scaling 将等到 Lifecycle Hook 处理完毕后再将实例投入使用。

您的错误消息似乎表明没有此类响应,因此实例已终止。您应该检查生命周期挂钩的 Auto Scaling 组配置。