19

I've got an AWS EC2 instance that I would like to create a spin off of in order to do some testing. I know I can create an AMI of the running instance, then launch that. But when I create the AMI, the machine goes down for a couple minutes (at least the network connection).

Is there a setting somewhere that I am missing?

I generate the AMI by right clicking the machine in the management console and selecting "Create AMI."

Thanks

Tyler DeWitt
  • 23,366
  • 38
  • 119
  • 196
  • 1
    I've never seen an EC2 instance go down while an AMI of it is being created. What symptoms are you seeing, and what type of instance is this ? – gareth_bowles Feb 08 '12 at 19:22
  • It's an m1.large running windows server 2008. We run Tableau Server on it, and when I generate the AMI, Tableau is inaccessible (both the login page and the data contained in teh server) for about 5-10 min. – Tyler DeWitt Feb 08 '12 at 19:50

2 Answers2

12

No. Not in a technical sense. The machine must reboot when you create an AMI. You are not losing network connection, your machine is actually restarting.

One thing you could do is copy your disk to another disk, but that is not easy to do.

Amazon EC2 powers down the instance, takes images of any volumes that were attached, creates and registers the AMI, and then reboots the instance. -http://docs.amazonwebservices.com/AWSEC2/2011-05-15/UserGuide/index.html?Tutorial_CreateImage.html

EDIT: I am looking at this answer again, and AWS now has the ability to check "no reboot" when creating an AMI. This is probably not a great idea for volumes with a lot of writes, but it is nice to have.

chantheman
  • 5,256
  • 4
  • 23
  • 34
  • Could I make a snapshot of the attached volume, start up another instance, then replace the volume of the new instance with the snapshot? – Tyler DeWitt Feb 08 '12 at 20:50
  • Yes you can make a snapshot of any volume and attach it to another instance, but if you do this to the root volume you risk the chance of some data corruption if writes are happening while the snapshot kicks off. My advise is to transfer any of the data you need to a separate EBS volume then run: sync and xfs_freeze -f /MOUNTEDVOLUME (xfs_freeze -u when you are done). This way you wont get any corrupted data. – chantheman Feb 08 '12 at 21:16
  • FWIW, the above refers to EBS backed instances. I think you can create an AMI of an S3-backed instance without incurring any downtime. – gareth_bowles Feb 08 '12 at 22:53
11

Amazon now allows a "no-reboot" option when creating an AMI, presented in a checkbox. However, the "file system integrity on the created image can't be guaranteed" so you'll have to weigh the integrity vs. downtime.

Martijn Heemels
  • 3,529
  • 5
  • 37
  • 38
jhchen
  • 14,355
  • 14
  • 63
  • 91
  • 2
    perhaps a good idea to do `fsck` on the root filesystem after the new one comes up. Only other case where this would be harmful I can see would be if filesystem had a database on it or similar. – Tom Harrison Jun 13 '13 at 17:34