DEV Community

Anurag Vishwakarma
Anurag Vishwakarma

Posted on • Originally published at firstfinger.in on

What is the difference between Snapshot & Image in AWS EC2?

AWS EC2 (Elastic Compute Cloud) is the most widely used service in the cloud computing industry by developers, system administrators, and businesses. EC2 lets users create and launch virtual machines in the cloud. When creating an EC2 instance, users have the option to create either a Snapshot or an Image.

Here, we will discuss the difference between Snapshot and Image in AWS EC2, their use cases, and how they differ from each other.

What is Snapshot?

A Snapshot is a point-in-time copy of an EBS (Elastic Block Storage) volume. When creating a Snapshot, AWS EBS takes a copy of the entire EBS volume and stores it in S3 (Simple Storage Service) buckets. This Snapshot can then be used to create a new EBS volume, which can be attached to another EC2 instance or the same instance it came from.

When creating a Snapshot, it only copies the data on the EBS volumes, not the operating system or applications installed on the EC2 instance. This feature is useful when only the data needs to be backed up and not the operating system or installed applications.

AWS EBS also supports incremental backup, which means that when an existing Snapshot is updated, only the changed data is backed up, reducing the time and cost of creating and maintaining backups.

What is Image?

An Image in AWS EC2 is a pre-configured image that contains an entire EC2 instance, including its operating system, applications, and data. An Image can be used to launch new instances with the same configuration as the original instance.

An Image can be used to launch new instances across multiple availability zones or regions. This feature is useful when users need to create a new EC2 instance in a different availability zone or region for the purpose of replication or scaling.

When creating an Image, users can customize the Image properties, including which storage volume to use as its root device, which kernel ID to use, and which block device mappings should be used. The Image can then be used to launch new instances with the same configuration as the original instance.


Difference between Snapshot and Image:

The primary difference between Snapshot and Image is the content. Snapshots only copy the data on the EBS volumes, while Images copy an entire EC2 instance, including the operating system, applications, and data.

Use Case : Snapshots are used for data backup and recovery, while Images are used for replicating and scaling EC2 instances.

Portability : Snapshots are portable, which means they can be used on any EC2 instance with the same EBS volume. On the other hand, Images are not that portable as they are tied to a specific EC2 instance configuration.

Size : Snapshots are usually smaller compared to Images as they only contain the data on the EBS volumes. On the other hand, Images are large as they include an entire EC2 instance configuration, including operating systems, applications, and data.

Cost : Snapshots are cheaper compared to Images as they only backup data, while Images backup an entire instance.


How to Create Snapshot and Image:

Creating a Snapshot:

Step 1: Navigate to the EC2 Dashboard and click on the EBS volume you want to create a Snapshot of.

Step 2: Click on the 'Actions' dropdown menu and select 'Create Snapshot'.

Step 3: In the 'Create Snapshot' dialog box, review the information and click on the 'Create Snapshot' button.


Creating an Image:

Step 1: Navigate to the EC2 Dashboard and click on the instance that you want to create an Image of.

Step 2: Click on the 'Actions' dropdown menu and select 'Create Image'.

Step 3: In the 'Create Image' dialog box, customize the Image properties, including the name, description, and volume settings.

Step 4: Click on the 'Create Image' button.

Conclusion:

In conclusion, Snapshots and Images both play an important role in Amazon EC2, and their use cases are different. Snapshots are useful when only the data needs to be backed up, while Images are useful when instance configuration needs to be replicated across multiple availability zones or regions, scaling, or when users want to perform a complete backup.

Snapshots are portable and can be used on any EC2 instance with the same EBS volume, while Images are tied to a specific EC2 instance configuration.

Amazon EC2 users should choose to create either a Snapshot or Image based on their specific goals and use cases.

Top comments (0)