The AWS documentation says that one can see details of AMIs by running the following:
aws ec2 describe-images
However, the returned description does not seem to include the kernel version (for Linux images).
Is there a way to find out the kernel of an AMI, other than starting and instance with it and looking inside?
(The reason I am asking is that I am currently trying to import an Ubuntu 18.04 image with aws ec2 import-image
, but getting a ClientError: Unsupported kernel version 5.3.0-61-generic
, so I would like to find out which kernels are supported, and I am not satisfied with the answers to the question What Linux Kernel Versions are Acceptable for AMI Import to Amazon Web Services?).
EDIT:
As it turns out, the kernels in existing AMIs are not necessarily supported for import. I created an Ubuntu 18.04 instance from an existing AMI, and determined its kernel to be 5.3.0-1023-aws
.
This kernel is available as an Ubuntu package, so I installed it on my VM, and tried to import it with aws ec2 import-image
, without success:
"Status": "deleting",
"StatusMessage": "ClientError: Unsupported kernel version 5.3.0-1023-aws",
However, even though the original motivation is moot, I am still interested in the original question: how to discover the kernel of Amazon AMIs.