Start aws instance from snapshot, can't find kernel ids
SHORT VERSION:
For AWS, how do you find the core id from a given ami or from an instance started with that ami.
LONG VERSION:
I have an aws instance where all drives are ebs backed. I am trying to run an exact copy of it from disk snapshots.
The first step in this process is to create a new ami from a snapshot of the root volume. When I did this earlier, I just looked for the ami id and found somewhere where the kernel id was posted for the standard ubuntu ami I selected from the aws console, but it doesn't seem to work this time.
A lot of searching, reading documentation and aws forums makes it sound like a kernel file should be filled in in the instance description, but to me (and many other people on the forums) its a gap. I tried to start a new instance (from console) [Amazon Linux AMI 2014.09 (HVM) - ami-08842d60] the kernel field is also blank for this.
If I create a completely new machine, take it off, and then leave the default kernel, the ami works fine, but none of the old ami I have tried by default.
Does anyone know what the process of finding a kernek id for ami is these days?
source to share
SHORT VERSION:
It seems that you don't need a kernel id at all if your ami is hvm if you've configured your options correctly.
LONG VERSION:
If you create your ami using a boto call like:
ami_id = conn.register_image(
name='some_name',
description='some_description',
architecture='x86_64',
root_device_name='/dev/sda1',
snapshot_id=snapshot_id,
delete_root_volume_on_termination=True)
It seems that if the instance of the original ami is the last hvm ami listed in the aws console. But stopped working as soon as aws updated its default ami. I assumed it because something on the backend is raising the correct kernel id or something. Either way, this work is VERY VERY REFERRED to!
However, if you set virtualization_type to hvm, it works consistently without a kernel id.
ami_id = conn.register_image(
name='some_name',
description='some_description',
architecture='x86_64',
virtualization_type='hvm',
root_device_name='/dev/sda1',
snapshot_id=snapshot_id,
delete_root_volume_on_termination=True)
On the other hand, if your instance is paravirtual, it seems that as long as you specify the kernel, you don't need to specify virtualization_type in the boto call.
source to share
Taken from AWS Documentation , you can find the kernel id with the following command in the running instance:
$ ec2-describe-instance-attribute instance_id --kernel --region region
Then you can get the version information:
$ ec2-describe-images [kernelID you got from previous command] --region region
edit: Just noticed that this is an HVM; Not sure why you want to take a snapshot from a snapshot. If you build the image directly from ec2, it will also create snapshots for you, and then you can go to the AMI and create a new ec2 from the image you created, and it will not ask for a kernel id.
If the instance is gone and you have nothing but snapshots, I could figure out what you are trying to do and instead of trying to make an AMI from your snapshot, just make volumes out of it. Then start a similar HVM based instance, let it load and then stop it. Change root volumes and start it.
source to share