Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Basically, I am trying to start an Amazon micro instance, install Java, Tomcat, MySQL and a few other things, then save a snapshot of the instance so that I can start many like it later on.

After many tries, I eliminated the software installation process and I am just going for cloning a running EBS backed AMI. Here is what I did:

  • Choose an EBS backed AMI (I have done Ubuntu ami-fd589594 and Debian ami-1212ef7b) and launch as micro instances
  • SSH successfully using my security group and my key
  • Go to EBS tab and right click on the AMI EBS and create a snapshot of the EBS
  • Create an image out of the snapshot
  • Launch an image created above using the same security group and key (as micro instance)
  • Try to ssh to it and.. unable to connect!

I have been unsuccessful, many times syslog is empty.

What am I missing?

share|improve this question
add comment

1 Answer

You haven't provided a lot of detail about exactly how you "create an image out of the snapshot" but based on what I see, I'm going to guess that you may not have specified the correct AKI or ARI.

If you create an image out of a snapshot of an EBS root volume, you need to specify the AKI (kernel) to use with the new AMI. Just use the same one that was used by the original AMI. If the original AMI used an ARI (ramdisk) specify that, too.

Or...

Instead of doing the snapshot and AMI registration in separate steps, you can do it all at once with the ec2-create-image command/API. This functionality is also available in the EC2 console as the menu item "Create Image (EBS AMI)" when you right click on the instance listing. Note that this will stop the instance temporarily to make sure the snapshot is consistent.

Here's a log of a session where I ran the Ubuntu AMI you describe above, performed an ec2-create-snapshot on the instance to create a new AMI, and ran an instance of the new AMI. I was able to ssh in just fine to the new instance of the new AMI.

$ ec2-run-instances --key $USER --instance-type t1.micro ami-fd589594
RESERVATION r-12ea647c  XXX default
INSTANCE    i-50b5a230  ami-fd589594            pending XXX 0   t1.micro    2011-10-19T07:26:37+0000    us-east-1d  aki-427d952b    monitoring-disabled                 ebs         paravirtual xen     sg-XXX  default

$ ec2-create-image -n "test AMI $(date +%Y%m%d-%H%M)" i-50b5a230
IMAGE   ami-4bbc7322

$ ec2-run-instances --key $USER --instance-type t1.micro  ami-4bbc7322
RESERVATION r-66e66808  XXX default
INSTANCE    i-f2b1a692  ami-4bbc7322            pending XXX 0   t1.micro    2011-10-19T07:32:37+0000    us-east-1a  aki-427d952b    monitoring-disabled                 ebs         paravirtual xen     sg-XXX  default

$ ssh ubuntu@107.20.99.70
[...]
ubuntu@domU-12-31-39-0C-08-75:~$ 

Note: In order to avoid having to specify -i KEYPAIR.pem in the ssh command I uploaded my personal ssh key to EC2 following the instructions I've written about here:

Uploading Personal ssh Keys to Amazon EC2
http://alestic.com/2010/10/ec2-ssh-keys

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.