Launching EC2 instance failed in Auto Scaling Group

0

I have an autoscaling group, recently change to attribute based selection, and now have many errors:

Launching a new EC2 instance. Status Reason: Internal error. Launching EC2 instance failed.

during attempts scale-outs. I can't find any more detail as to what the error is.

Jon
질문됨 일 년 전1371회 조회
1개 답변
0

I just found this in the CreateFleet event in Cloudtrail; I guess it could be the answer:

    "responseElements": {
        "CreateFleetResponse": {
            "fleetInstanceSet": "",
            "xmlns": "http://ec2.amazonaws.com/doc/2016-11-15/",
            "requestId": "7f5a500b-xxxxx",
            "fleetId": "fleet-f33db92e-xxxxxx",
            "errorSet": {
                "item": {
                    "errorCode": "UnfulfillableCapacity"
                }
            }
        }
    },

Update: seems like including some availability zones in the networking config for the ASG causes this problem. In my case, the CreateFleet request was attempting to create in us-east-1e - once I took that out of the network config, the following CreateFleet requests succeeded. I was under the impression that ASG/Spot took care of this case, but doesn't seem that way.

Jon
답변함 일 년 전
  • The subnet/AZ decision is made by the ASG, so you don't need to/shouldn't include info on them in the launch template (the entire Network section of the launch template usually can be ignore when used with an ASG). That said, we want to handle errors as gracefully as possible. Can you let me know exactly which setting you changed/removed?

    The error you listed is saying there was no capacity for the selected instance types, but there may have been an issue with the combination of settings selected also

  • @Shahad_C I had no AZ config in the launch template, but do have in the ASG config. The change (in terraform code) that got things working is:

    -data "aws_availability_zones" "available" {
    -  state = "available"
    -}
    -
     resource "aws_autoscaling_group" "renderer_spot" {
    -  availability_zones = data.aws_availability_zones.available.names
    +  availability_zones = formatlist("%s%s", var.aws_region, ["a", "b", "c", "d", "f"])
    

    i.e. removing us-east-1e from the list of AZs. So you are saying it is unnecessary to provide availability_zones at all?

  • @jon thanks for those detail. You do need to specify the AZs in the ASG configuration. I thought you were talking about the network config section of the launch template (that's where subnet info doesn't need to be specified). Status Reason: Internal error shouldn't be caused by UnfulfillableCapacity, so I'd guess there was a different CreateFleet call related to the initial error (AutoScaling will make one call per AZ when its launching in multiple at once). Without having more details, my best guess would be the attributes matched with an instance type in AZ-e that couldn't be launched (architecture mismatch, or something like that)

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠