Is Amazon Machine Image (AMI) immutable?

(Thanks in advance for putting up with my seemingly stupid question).

I mean: Consider a Windows 2003 VMWare image. If I 1 - run this image and then 2 - run the program that writes something to the file and then 3 - stop the VMWare image and then 4 - run the VMWare image. then this file is still on the hard disk of the VMWare image.

Is this the case for OMI? Or if my AMI stops, will I lose any changes?

thank

+2


source to share


3 answers


AMIs are immutable. Each time you launch an AMI instance on EC2, the local disk is in the exact state when you created (or "linked") the AMI.

However, you can attach persistent storage (EBS) to an instance, or push things to S3 (vai s3sync, etc.), or attach to a database (RDS) to have data that lives over the lifetime of the instance.

But none of them are enabled by default.



I believe it would be possible to write a script that was executed on boot and connected to the EBS volume (or pulled a previously generated file from S3, or connected to an RDS instance). If you put this on an image before linking, it will execute every time you run. Here is the recipe I found for creating and attaching an EBS volume on boot (I haven't tested it, caveat emptor).

Most likely, as close as possible to what VMWare provides with EC2.

+3


source


If your instance stops, everything disappears that is not part of the original image.

you need to link the instance to the image in order to save the changes.



according to this link

to store the data that you put into EBS.

+1


source


An instance is a copy of an image. You can run as many instances of the same image as you like. The image itself is unchanged.

EC2 instances are temporary. All data on the disks of an instance is lost when you close it.

You can store data permanently on EBS (or S3).

0


source







All Articles