0

I have to create either an Amazon EBS snapshot or an AMI from an instance to keep backup of those instances before terminating them. I have some questions related to this which I am not able to figure out:

  1. If we create an AMI or EBS snapshot of the instance, will the Docker and EC2 logs be available?
  2. Creating an instance from the AMI and Snapshot both to make sure #1 is identical to the original instance for the logs present?
  3. Which one is cost effective?
  4. If we create an AMI of a reduced size of an instance, what is the downside of it, which information/data is lost needs to be tested?
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Vatsal Rahul
  • 347
  • 1
  • 4
  • 19
  • _WHY_ do you wish to "keep backup of those instances before terminating them"? Do you wish to keep access to the _data_ (eg log files) that were on the instances, or do you have a need to potentially start the instance in future and have it operating again? If it is just data, then it would be advisable to copy the data to Amazon S3. Feel free to edit your question to add more details. – John Rotenstein Sep 23 '19 at 18:19
  • and if i say that i may need to potentially start an instance in future too ? – Vatsal Rahul Sep 23 '19 at 18:26
  • Well, the 'best' way to provision instances is via a script that can rebuild the system by installing the necessary software, rather than manually building the instance. This way, a new instance can be configured via the script, rather than having to keep an AMI. – John Rotenstein Sep 23 '19 at 18:29

2 Answers2

1

If you want to be able to boot and use the instance again in future, then an AMI is required.

AMIs and Snapshots are not particularly expensive because they only contain blocks that have been added/modified from the original AMI. It does not store empty blocks.

The AMI and Snapshots will contain an exact copy of the disks at the time that they AMI/snapshot was made. No data will be lost.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
0

An AMI is an EBS snapshot plus a little information about the EC2 instance it was created from.

If an instance has more than one EBS volume attached, then an AMI would tie together all the snapshots of all the volumes into a single entity.

An AMI is much quicker and easier to create a new EC2 instance from.

Cost wise, I believe they cost the same, since you are only charged for the storage space used.

Mark B
  • 183,023
  • 24
  • 297
  • 295