Migrating From gp2 to gp3 Volumes to Lower AWS EBS Costs
Save up to 20% on AWS EBS costs by switching from gp2 to gp3 volumes. This guide shows you how to easily make the change and optimize your expenses.
Save up to 20% on AWS EBS costs by switching from gp2 to gp3 volumes. This guide shows you how to easily make the change and optimize your expenses.
Amazon Elastic Block Store (EBS) is a block-storage service designed for virtual machines (Amazon EC2). It is an easy-to-use, high-performance solution that provides volumes that can be attached to the EC2 instances. EBS provides several volume types, each optimized for a specific category of workloads. The most popular type, which fits the most workloads, is the general purpose volume. It is backed by solid-state drives and presented by two generations – gp2 and gp3.
In December 2020, Amazon Web Services (AWS) announced the availability of gp3, the latest version of general purpose SSD volumes for Amazon EBS.
Prior to this, there had been only a linear relationship between EBS volume performance and storage capacity, which led to over-provisioning and non-cost-effective pricing. Now, with gp3, if you require higher IOPs (input/output operations per second) and throughput, you don’t need to pay for excess storage in addition.
Additionally, when you switch from gp2 volumes to gp3 volumes, you lower your costs by 20%. For example, in the US-East-1 region, gp2 volumes cost $0.10/GiB-month compared to gp3 volumes at $0.08/GiB-month.
With gp3 volumes, you get a baseline performance of 3,000 IOPs and 125MB/s at any volume size, with the ability to scale up to 16,000 input/output operations per second (IOPS) and 1,000 MiB/s for additional fees. With high performance and lower costs, making this switch is easy to justify.
In this guide, we’ll show you how you can switch your gp2 volumes to gp3 to take advantage of the new generation.
The table below shows the price differences between gp2 and gp3 volumes in various AWS regions, along with the savings you can achieve by switching to gp3. Use it to quickly assess how much you can save with gp3 based on your region.
Additionally, increasing volume performance (IOPS) for gp3 doesn’t require purchasing of additional disk space - baseline performance is 3000 IOPS, and it can be increased separately for 0.005$/IOPS . For example, you need a 300 Gib disk with 4500 IOPS. For gp3 it will cost:
0.08 * 300 + 1500 * 0.005 = 31.5$/month
For gp2, to get 4500 IOPS you will need to increase the disk size to 1500Gib:
1500 * 0.1 = 150$/month
Which gives around 79% of savings.
As with all other administrative operations, migration from gp2 volumes to gp3 can be done via AWS console or AWS CLI. Management of AWS resources using a console is more user-friendly, doesn’t require any skills, and is perfect for single changes, such as a change of volume type for a couple of virtual servers. AWS CLI approach requires some scripting skills and can be used for simple automation and batch jobs. To switch from gp2 volume to gp3 using the AWS console, perform the following steps:
1. Open EC2 console, and navigate to the Volumes under the Elastic Block Store section.
2. In the search field, enter “type=gp2” to filter the list of the volumes.
3. In the list of gp2 volumes, select the one you want to modify, then navigate to Actions>Modify Volume.
4. Modify the Volume Type field by selecting the gp3 option from the drop-down list. Optionally, adjust other parameters, such as size, IOPs and throughput. Then, press the Modify button to apply the changes.
5. In the confirmation window, select Modify again.
After this, the volume type will change without the need to restart the virtual machine or dismount the volume.
To modify the type for all the legacy gp2 volumes, AWS CLI should be used.
1. Open CLI and run the following command to list all the existing gp2 volumes:
The output will contain a table that shows the volume information:
2. Then, you can run the following script to perform the migration:
It will return output like this for each volume:
3. To ensure the volume modification was successful, run the command from step 1 again.
Switching your gp2 volumes over to gp3 volumes is a simple way to lower your costs, but the process requires manual action on each volume. If you have dozens or hundreds of gp2 volumes, this can be highly time-consuming. And then what happens if an even more cost-effective gp4 volume is announced?
For migrations like these, automation can save you significant time and make these optimizations more feasible at scale.
With Blink, you can run this automation to identify and alert you to any gp2 volumes associated with your EC2 instances. You can then click a button in Slack and migrate that volume to gp3 instead.
Blink Automation: Find and Upgrade AWS EBS gp2 Volumes
When this automation runs, it executes the following actions:
You can import this automation from the Blink library and customize it however you like.
In Blink, you can also create automation from scratch to meet your team’s unique needs using the hundreds of drag-and-drop actions available from a wide range of tools.
Get started with Blink today and see how easy automation can be.
As mentioned above, gp2 has no advantages over gp3, it is both more expensive and less productive, so there is no scenario where gp2 volume type is preferable. After migrating all existing gp2 EBS volumes to gp3, you’d probably like to prevent the creation of legacy volumes in your organization. This can be achieved using AWS Service Control Policies (SCP), which are used to manage permissions at the organizational level. In our scenario, we should create a policy that will prevent the running of instances with gp2 volumes:
1. Navigate to the AWS Organizations console. Go to the Policies section and select Service Control Policies.
2. On the page that appears, select Enable section control policies.
3. Press the Create Policy button.
4. In the wizard, specify the policy name, then scroll down to the statement field.
5. In the statement field, paste the below JSON-formatted information and select Create Policy.
Once the policy is applied, your organization will no longer be able to use instances with legacy volumes, helping prevent wasted AWS resources and ensuring full advantage of gp3 volumes.
Migrating from gp2 to gp3 is a straightforward, cost-effective upgrade. It reduces storage costs by 20% and boosts performance without requiring additional capacity. Automating the process through AWS CLI or tools like Blink can save significant time, especially for larger environments. Once migrated, enforcing policies to prevent future gp2 usage ensures long-term efficiency and cost savings.
gp2 ties performance to volume size, while gp3 offers more flexibility:
gp3 is designed to be more cost-efficient while offering better performance options:
gp3 is ideal for general purpose workloads without over-provisioning storage - great for databases, virtual desktops, Hadoop clusters, and any application that doesn’t require more than 16000 IOPS..
Yes, you can make the migration much easier with automation:
In some low-demand scenarios, gp2 could still be the right fit:
Generally, gp2 doesn’t have any advantages over gp3, and in almost any case gp3 is the preferable option.
Blink is secure, decentralized, and cloud-native. Get modern cloud and security operations today.