Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon EC2 EBS backup: AMI vs Snapshot

I am trying to create a backup mechanism for our server, so that if my system crashes, I should be able to create the whole system by running a single script

After going through Amazon documentation, this is my understanding of creating a backup and restoring

Backup

  1. Create a AMI Image (this can be updated monthly)
  2. Create a snapshot (This can be done using a daily script creating a snapshot)

Restore (A script to)

  1. Create an EBS instance using AMI
  2. Attach the EBS volume to Instance created

Now my Questions is

  1. Is it the best way to take a backup and restore?
  2. Do we actually need to backup 2 things, AMI and EBS volume (using snapshot), Can we just keep snapshots?
  3. I understand this cannot work for a local instance store instance, as there is no snapshot functionality. So how can I create a backup and restore process for local instance store instances?
like image 691
Kamal Avatar asked Dec 12 '12 06:12

Kamal


People also ask

What is the difference between an Amazon Machine Image AMI and an EBS snapshot?

An EBS snapshot is a backup of a single EBS volume. The EBS snapshot contains all the data stored on the EBS volume at the time the EBS snapshot was created. An AMI image is a backup of an entire EC2 instance. Associated with an AMI image are EBS snapshots.

What is the difference between AWS snapshot and backup?

An AWS snapshot is just a point-in-time copy of an Amazon EBS volume with limited storage and recovery options. A backup is a more comprehensive and flexible copy of your VMs that offers reliable protection and ensures fast and consistent recovery.

Does AMI backup EBS?

Amazon Machine Images (AMIs) are archival copies of instances that you can use to launch other instances. If you have an Amazon EC2 instance that's backed by an Amazon Elastic Block Store (Amazon EBS), use custom AMIs to launch multiple copies of one instance, or use a custom AMI as a backup solution.

What is the difference between EBS volume and snapshot?

An EBS snapshot is a point-in-time copy of your Amazon EBS volume, which is lazily copied to Amazon Simple Storage Service (Amazon S3). EBS snapshots are incremental copies of data. This means that only unique blocks of EBS volume data that have changed since the last EBS snapshot are stored in the next EBS snapshot.


2 Answers

As I could not find any better alternative, I am sticking with the initial approach.

For EBS

Backup:

  • Create a AMI Image (this can be updated monthly).
  • Create a snapshot (This can be done using a daily script creating a snapshot).

Restore (A script to)

  • Create an EBS instance using AMI.
  • Attach the EBS volume to Instance created.

For instance store, I am only keeping the application (no database), so no need to keep a backup of that.

like image 130
Kamal Avatar answered Sep 25 '22 00:09

Kamal


EBS Snapshots are an excellent way to create backups.

You can perform frequent Snapshots of your EBS Volumes via scripts. Weekly, Daily, Hourly, or as frequently as your Credit Card will allow. The only limit is around how many simultaneous snapshots you can be doing - when you hit that, the EBS API will start giving back errors until a few of the in-flight operations complete.

Snapshots can also be copied from Region to Region in order to provide backup against a catastrophic event.

When you snapshot an EBS volume, that snapshot is of the entire volume. Even if it was created from an AMI, your snapshot contains everything you need to create a new instance of the volume. You can pretty easily try this yourself.

like image 31
Chris M. Avatar answered Sep 26 '22 00:09

Chris M.