0

I have an EC2 instance running. I want to switch it off and preserve all its data and config so that I can revive it anytime I want with same set of data and config without any loss.

How can i do it?

Regards.

0

3 Answers 3

6

A few things to note here:

  • Use an AMI image that is EBS-backed. This means your root partition is on an Elastic Block Store, which gives you a lot of flexibility. Almost every recent public AMI image has this configured. This will allow you to 'Stop' an instance without 'Terminating' it. Do not use an instance-store AMI.

  • If you are concerned about data loss, take a snapshot of your volume. This can be done while the machine is running, but it is safer while it is stopped.

  • By default, EBS volumes are deleted when you terminate an instance, though this is configurable.

  • For good measure, enable termination protection. This prevents you from accidentally terminating your instance and only allows you to stop it. This setting can be changed at any time.

1
0

I use EBS backed volumes for this reason. You can create an image AMI on the fly from an ebs backed instance. The create EBS image option is under the drop down menu where you start,stop,terminate... Keep in mind, you need to pick EBS compatible images when you first setup the server. Last time I checked, most of the public amazon instances in the classic setup are s3 backed. I created my own image from scratch so I could use EBS. Double check that. Amazon might have started offering EBS on their template images.

1
  • Thanks a lot. Now i could find 2 ways to do it for EBS backed instances: One is to select an instance in AWS console & under "Instance Action" menu, i can see 'Create Image(EBS AMI)'. Second is to create a snapshot from volume attached to an instance and then create image from snapshot. I was also successful in launching new instance from AMI i created using any of above steps.But i want to knwo how can i create AMI for an instance store backed instance not EBS backed?
    – Finn
    Nov 8, 2012 at 5:45
0

There are 2 ways to preserve EC2 instances for EBS backed stores: One is to select an instance in AWS console & under "Instance Action" menu, i can see 'Create Image(EBS AMI)'. Second is to create a snapshot from volume attached to an instance and then create image from snapshot.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .