0

I've followed these instructions to duplicate an AWS, EBS-backed EC2 instance and I'm running into a snag.

This is exactly what I've done:

  1. Created an AMI from the original instance (instance panel: actions>create image)

  2. Launched the AMI as instance using the current keys (AMI panel: launch)

  3. Created a new elastic IP and associated it with the new instance.

Problem: Everything seems fine but I lost connection to the original instance. I ran trace routes for the original IP and it's dropping when it reaches amazon. It doesn't seem to exist despite that it is showing in my panel, associated with the original instance and likewise, the original instance points to the correct IP address.

To trouble shoot, I have now:

  1. Deleted the new AMI

  2. Deleted the new instances

No change. What am I doing wrong? How do I properly duplicate an instance that I can then point to a different IP?

Thank you,

J

Community
  • 1
  • 1
user3426546
  • 3
  • 1
  • 3

1 Answers1

0

It seems that you did nothing wrong when setting up a new instance.

I don't know what you had in that instance, but one idea I have is that when you create an AMI from an instance, the default behavior of AWS is to reboot the instance:

Amazon EC2 powers down the instance before creating the AMI to ensure that everything on the instance is stopped and in a consistent state during the creation process. If you're confident that your instance is in a consistent state appropriate for AMI creation, you can tell Amazon EC2 not to power down and reboot the instance. Some file systems, such as xfs, can freeze and unfreeze activity, making it safe to create the image without rebooting the instance.

Maybe your web-server does not start on system start-up?

Uri Agassi
  • 36,848
  • 14
  • 76
  • 93
  • Thank you Uri. I'm not sure the issue is with the instance. The issue seems to be with the IP address, except that there is nothing obvious I can see related to the IP address. The instance is pointing to the right address and the address is associated with the right instance. Also, I've rebooted in the past without issue. – user3426546 Mar 16 '14 at 22:05
  • Can you connect to your instance via ssh? – Uri Agassi Mar 17 '14 at 05:27
  • Yes, I can connect via SSH, telenet and SFTP but not HTTP/HTTPS. – user3426546 Mar 17 '14 at 16:48
  • I've used a terminal window to ping or trace route... http://www.wikihow.com/Ping-an-IP-Address Neither the server address nor the IP resolve when I ping/trace it. They drop when they reach Amazon. They don't appear to exist. – user3426546 Mar 17 '14 at 16:49
  • Ping will not answer you by default on EC2 (you should open the ICMP port in the security group - http://aws.amazon.com/articles/1145?_encoding=UTF8&jiveRedirect=1#18). If you can SSH to your machine (using the elastic IP, I can only guess) - there is no problem with the IP address. Can you reach your server from that machine? (SSH to it and `curl localhost`)? – Uri Agassi Mar 17 '14 at 17:09
  • Thank you. I looked into ICMP. I'll need to come back to it later. As for SSH, I typed 'curl localhost' and got a blinking cursor. I can log into SSH but this is starting to go going beyond my capabilities. However, I did find two relevant articles: the first points to having to turn on services. http://stackoverflow.com/questions/11075831/ec2-instance-stopped-working-after-creating-an-image?rq=1 The second points to a bug. http://stackoverflow.com/questions/17296655/ec2-instance-launched-from-ami-not-reachablessh-after-start-stop-or-reboot?rq=1. Unfortunately, – user3426546 Mar 17 '14 at 18:04
  • cont'd: I'm not qualified to look into either. – user3426546 Mar 17 '14 at 18:13
  • The second is irrelevant to you, since it says that he could not connect via ssh, and the first is _exactly_ like your situation, and the answers say _exactly_ what I recommended in my answer... – Uri Agassi Mar 17 '14 at 18:14
  • The 'curl localhost' eventually responded as follows - 'curl: (56) Recv failure: Connection reset by peer' – user3426546 Mar 17 '14 at 18:34
  • make sure your server/nginx/whatever is up – Uri Agassi Mar 17 '14 at 18:35
  • Thank you Uri for all your help. I don't know command language but will look for help getting everything back up and running. – user3426546 Mar 17 '14 at 18:43