Skip to main content

EC2 instance 종료와 Volume snapshot 저장 (작업중)

Costs are an important consideration while running workloads on the cloud. Being cognizant about how services incur costs helps in savings, adoption of efficient workflows, and use of sophisticated services that are better tailored for your current workload. It is a good practice to understand how the usage of specific features and services can lead to saving costs.

In this section of the workshop we will provide a brief introduction to costs associated with services on AWS as well as demonstrate how costs could be saved for specific services taking services like EC2 and EBS.

 

Exploring EC2 Instance Lifecycle

An Amazon EC2 instance transitions through different states throughout its lifecycle.

To view the current instance state of an EC2 Instance:

  1. In the AWS Management Console search bar, type EC2.

  2. Choose EC2 to open the EC2 Dashboard.

  3. In the left navigation pane select Instances under the Instances section.

  4. To see the current instance state, select your EC2 Instance and observe the value under the Instance state column. The status will indicate Running, Stopped or Terminated.

AWS Management Console

Below is a diagram of an EC2 instance lifecycle. Note that the instance state affects the costs while using EC2. For more information see Instance Lifecycle

AWS Management Console

Very briefly, an EC2 instance will accumulate cost while it is running. When you stop the EC2 instance, you no longer accumulate costs associated with it.

However, you will always be charged for the storage on your machine. Whether it’s the storage on the root drive or EBS volumes attached to your root, these costs do not stop when your machine is stopped. They will only cease when you permanently delete these volumes. Furthermore, you pay for the entire storage present on the disk, not just what you use. Make sure to select resources appropriate for your project.

 

Detach the additional EBS Volume

 

  1. In the AWS Management Console search bar, type EC2.

  2. In the left Navigation pane click on Instances under the Instances section.

  3. Select your EC2 Instance and in the Instance Details pane below, select Storage to view the Block Devices and then click on the Volume ID of your additional EBS Volume attached previously (e.g. /dev/sdh; the device name may be different in your case).

Screenshot 2023-09-27 at 6.06.44 PM.png

This will open the Volumes page showing the specific Volume details.

  1. Click on the Actions button and further click on Detach Volume to detach the volume from the EC2 Instance.

Screenshot 2023-09-27 at 6.07.48 PM.png

  1. In the Detach Volume dialog box, click Detach; the volume will now be detached and in a few moments the Status of the volume will change to available, indicating that it could be attached to another instance if required.

Screenshot 2023-09-27 at 6.08.28 PM.png