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.

I remember being able to do this once, perhaps via ElasticFox, but the extension does't seem to load on Firefox 7.0.

The AWS Console does't seem to support hot image creation - when I do create an image, the machine is rebooted.

Is there another easy way to do this, or must I finally get acquainted with the EC2 command line tools?

share|improve this question
    
You were able to create a running snapshot of your computer's system drive to a remote system from your web browser without any reboot? I hadn't used EC2 but that sounds a bit like a security issue. –  Bart Silverstrim Oct 26 '11 at 12:47
    
@BartSilverstrim - the snapshot was of an EC2 instance via Amazon APIs, not of my own computer :) –  ripper234 Oct 26 '11 at 12:52
    
Ah, that's a little different. Thanks for the clarification! –  Bart Silverstrim Oct 26 '11 at 12:54
    
For future reference, this is how you do it with a commandline tool: ec2-create-image --no-reboot instance_id In this question I'm looking for a GUI/webapp way to do it. –  ripper234 Oct 26 '11 at 14:14

2 Answers 2

up vote 4 down vote accepted

The reason you want to stop your instance while the AMI is created (default behavior) is so that the snapshot of the root file system is completely consistent. Without this, you risk copying the block device while not all application or system file system changes have not yet been written from memory to disk.

This risk is increased the more active your server is with disk writes.

If you have a fairly quiet server, you can create an EBS boot AMI without stop/start (reboot) using these steps:

WARNING! THESE STEPS ARE NOT THE RECOMMENDED WAY TO CREATE AN AMI (IMAGE) FROM A RUNNING INSTANCE

  1. If possible, log in to your server and run the following command to flush pending writes to disk. Writes made after this command may not make it to disk and applications may be saving their own changes in memory getting ready to write to disk, so there's your risk of inconsistency.

    sudo sync
    
  2. Create a snapshot of your root EBS volume and wait until it has completed.

  3. Register the snapshot as an AMI (Image).

Steps 2 and 3 can be done through command line or through the EC2 console.

The tricky part is that you need to pick the correct AKI (kernel) and ARI (ramdisk) when you register the snapshot as an AMI. Find the kernel and ramdisk that were used by your running instance and use the same ones. For modern Ubuntu AMIs, no ramdisk is needed so leave it unspecified.

Test the new AMI carefully to make sure that you didn't create problems by not having a consistent file system. Note that problems may take a while to show up as they could be with any file/directory that was open near the time of the snapshot.

I cared so much about creating consistent snapshots, that I put together the community's best practices and published a command line tool to do it on a running system:

ec2-consistent-snapshot
http://alestic.com/2009/09/ec2-consistent-snapshot

This may not be the best choice for EBS root volumes, though, as there are open log files and other conflicts that may be possible. Plus, most people aren't running XFS in the root disk.

share|improve this answer

Do it via their web interface, or with the command line, but in both case, the instance but be rebooted. This is necessary to perform a clean snapshot of your root file system and transform that into an AMI.

share|improve this answer
    
But ... there was a way to do it without rebooting, I know it. See also forums.aws.amazon.com/message.jspa?messageID=159969 –  ripper234 Oct 26 '11 at 12:55

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.