Correct process for starting new EC2 Instance from an EBS snapshot

Solution 1:

The errors you got suggest that your file system is more recent than that supported by the kernel (most likely an ext4 on a kernel that only supports ext2/3). Some AMIs depend on a non-standard AKI (Amazon Kernel Image) to provide certain features.

In this case, the procedure you have followed seems correct, therefore, when combined with the error you received, there is a good chance that the AKIs do not match. Check the AKI used by the original instance, and compare it to that of the new instance. If they don't match, explicitly specify the AKI at launch time. (You can also manually create the AMI and in doing so, specify the AKI at that time so that it need to be specified at launch).

As an aside, a better AMI design will use PV-GRUB as a bootloader to load a kernel from the AMI itself (instead of requiring a specific external AKI), which simplifies the process of keeping the kernel up to date. The AWS documentation on user provided kernels is worth reading if you want to implement this in your AMI.

Solution 2:

Because you mentioned Ubuntu specifically, this tool may be helpful to you:

  • http://cloud-images.ubuntu.com/locator/ec2/

I had the same thing happen, and choosing the correct AKI for the OS version and architecture using the tool above worked like a charm.

Solution 3:

I came across similar problem, and it turns out, AWS EC2 defaults differ for launching instance vs. creating an AMI: hardware virtualization (HVM) is the default choice in first case, but paravirtual (PV) is the default for image creation.

I stumbled upon this when tried to move EC2 instance between availability zones by snapshotting its EBS volume and creating a new AMI, and this discrepancy in settings (which I did not pay attention too) wasted an hour for me.

So, tl;dr: just choose HVM when launching from a customized AMI and your instance should boot fine.