Launching EC2 instance failed in Auto Scaling Group


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.

preguntada hace 2 años1389 visualizaciones
1 Respuesta

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

    "responseElements": {
        "CreateFleetResponse": {
            "fleetInstanceSet": "",
            "xmlns": "",
            "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.

respondido hace 2 años
  • 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)

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas