The process of deleting Orphan EBS Volumes for reducing cost
AWS Services:
- Elastic Compute Cloud (EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. EC2's simple web service interface allows you to obtain and configure capacity with minimal friction.
- Elastic Block Store (EBS) is an easy to use, high-performance, block-storage service designed for use with Elastic Compute Cloud (EC2) for both throughput and transaction-intensive workloads at any scale.
- An EBS snapshot is a point-in-time copy of your Amazon EBS volume, which is copied to S3 bucket. EBS snapshots are incremental copies of data. An AWS snapshot contains all the information required to restore your data starting from the moment of creating the EBS snapshot.
Description of the finding:
An EBS volume has become orphaned as there is no associated EC2 instance. A resource can become “orphaned” when it is detached from the infrastructure it was created to support, such as a volume detached from an instance or a snapshot detached from any volumes. Whether you are aware these remain in your cloud environment or not, they can continue to incur costs, wasting money and driving up your cloud bill.
EBS storage costs depend on how much EBS storage is provisioned in a particular account in terms of gigabyte-per-month. While EC2 instances only accrue charges while they’re running, the EBS volumes attached to instances continue to retain information and hence accrue charges, even when the instance is stopped.
Orphaned volumes should exist
Does Company have a Long-term/Short-term Backup Strategy?
If they have any retention requirements ie.., Regulatory or compliance, and act as such ie if they have a 3 or 5 or 7-year retention posture.
Need to check if the backup is required in case they want these volumes for later use by the client; Perform a Snapshot of the volume
You have to understand and acknowledge any remediation activity/task performed and give a clear approval before performing the task.
Make sure all the configurations are noted.
Recommendation:
As EBS storage is not attached to EC2 and so it can be removed to save cost. The following resources are listed below:
*Resource information Listed below*
Note: Coordinate with client to get Approval to Proceed to Remediate the issue and check if the backup is required if they want these volumes for later.
Affected Service Dependencies:
Elastic Block Storage - Volumes
Snapshots
EC2 instances
Remediation Plan:
There are two methods, you can choose from:
ONLY Delete -Delete the unused Amazon EBS Volumes without Backup(Destructive Method).
Backup up the Volume and Delete - Yes/No
Current Status: (Check whether your AWS account has unused EBS volumes)
Sign in to AWS console
Navigate to EC2 service https://console.aws.amazon.com/ec2/
Click on the Volumes, under Elastic Block Storage in the left navigation pane
To know the unused volumes check the status of the volumes under the state column
If the status is in use, the volume is currently attached and cannot be deleted
If the status is available, the volume is not attached to an EC2 instance and can be safely deleted
Implementation steps:
Method 1: ONLY Delete - the unused Amazon EBS Volumes(Destructive Method)
Sign in to the AWS Management console
Navigate to EC2 service https://console.aws.amazon.com/ec2/
Click on the Volumes, under Elastic Block Storage in the left navigation pane
Select your unattached volume (i.e, State - Available)
Select the volume, click on the Actions dropdown button and select Delete Volume
Method 2: Backup up Volumes and Delete
Sign in to AWS console
Navigate to EC2 service https://console.aws.amazon.com/ec2/
Click on the Volumes, under Elastic Block Storage in the left navigation pane
Select your unattached volume (i.e, State - Available)
Create a snapshot of your volume. If you want to backup your volume before deleting it, take a snapshot.
Select the volume, click on the Actions dropdown button and select Create Snapshot.
Select the volume, click on the Actions dropdown button and select Delete Volume
Status after Implementation:
Validate if there are still any unused volumes in the EBS that incur a cost. Go to EC2 console, click on volumes in the left navigation panel, check and confirm that there is no volume with state available(Details refer to the Implementation Plan - Current Status section)
Back Out Plan: (If you want to restore volume from snapshot)
Sign in to AWS console
Navigate to EC2 service https://console.aws.amazon.com/ec2/
Click on snapshots under Elastic Block Storage, in the left navigation pane
Select the snapshot that needs to restore from the list of snapshots available in your account and click on the Actions dropdown button and then click on create Volume
Total Cost Savings(Yearly)
https://aws.amazon.com/ebs/pricing/
The cost depends on the following factors:
Depends on the Region where the EBS Volume exists.
Depending on the type of EBS Volume
Depends on Snapshots or Fast Snapshot Restore or EBS direct APIs for Snapshots
Pricing examples
EBS General Purpose SSD (gp2) Volumes
Volume storage for General Purpose SSD (gp2) volumes is charged by the amount you provision in GB per month until you release the storage. Provisioned storage for gp2 volumes will be billed in per-second increments, with a 60-second minimum. I/O is included in the price of the volumes, so you pay only for each GB of storage you provision.
For example, let's say that you provision a 2000 GB volume for 12 hours (43,200 seconds) in a 30 day month. In a region that charges $0.10 per GB-month, you would be charged $3.33 for the volume ($0.10 per GB-month * 2000 GB * 43,200 seconds / (86,400 seconds/day * 30 day-month)).
EBS Snapshots
Snapshot storage is based on the amount of space your data consumes in Amazon S3. Because Amazon EBS does not save empty blocks, it is likely that the snapshot size will be considerably less than your volume size. For the first snapshot of a volume, Amazon EBS saves a full copy of your data to Amazon S3. For each incremental snapshot, only the changed part of your Amazon EBS volume is saved.
Copying EBS snapshots is charged for the data transferred across regions. After the snapshot is copied, standard EBS snapshot charges apply for storage in the destination region.
Reference:
https://aws.amazon.com/blogs/mt/controlling-your-aws-costs-by-deleting-unused-amazon-ebs-volumes/