How do I resolve the "Server.InternalError: Internal error on launch" error for a failed stack in AWS CloudFormation?

Last updated: 2019-05-17

I tried to create an Amazon Elastic Compute Cloud (Amazon EC2) instance with an AWS CloudFormation stack, but my stack creation failed. Then, I received the "Server.InternalError: Internal error on launch" error message. How can I resolve this error?

Short Description

You receive this error if duplicate or invalid device mappings are specified in your AWS CloudFormation template. You can't have two block devices map to the same location (for example, /dev/sdb).

Note: If you're using a Nitro-based instance type (for example, c5, m5, or T3), you won't receive this error, because /dev/sdb and /dev/xvdc are mapped to two different NVMe devices in the OS.

Resolution

In the BlockDeviceMappings property of your AWS CloudFormation template, confirm that your block devices are not mapping to the same location by checking the value of DeviceName for each of your block devices.

In the examples below, the block devices specified are /dev/xvdb and /dev/xvdc. The root volume is automatically provisioned for the instance, and the block devices are associated as secondary volumes.

JSON template:

    "Ec2Instance" : {
      "Type" : "AWS::EC2::Instance", 
      "Properties" : {
        "...OtherProperties..."
        "BlockDeviceMappings" : [
          {
            "DeviceName" : "/dev/xvdb",
            "Ebs" : { "VolumeSize" : "100" }
          },{
            "DeviceName" : "/dev/xvdc",
            "Ebs" : { "VolumeSize" : "100" }
          }
        ]
      }
    }

YAML template:

EC2Instance:
    Type: AWS::EC2::Instance
    Properties:
        ...OtherProperties...
        BlockDeviceMappings:
        -
          DeviceName: /dev/xvdb
          Ebs:
            VolumeSize: 100
        -
          DeviceName: /dev/xvdc
          Ebs:
            VolumeSize: 100

Did this article help you?

Anything we could improve?


Need more help?