Migrate EBS Volumes from gp2 to gp3
What It Does
Migrates Amazon EBS volumes from gp2 to gp3. The gp3 volumes offer better price-performance compared to gp2, allowing cost savings without compromising performance. This migration is performed safely with snapshot backup and volume modification.
Risk and Scope
Risk Level
Low
AWS Service Targeted
EC2 / EBS
Permissions Required
Modify and Create Permissions
- ec2:ModifyVolume
- ec2:CreateSnapshot
Read Permissions
- ec2:DescribeVolumes
- ec2:DescribeSnapshots
These permissions are granted only to the runbook, not to the OneLens platform itself.
Optimization Policies Addressed
This runbook remediates violation tickets triggered by of the following policy:
ebs_1
General purpose EBS volumes should be of gp3 volume type
Risk Mitigation
Risk Mitigation Strategy
- Snapshots are taken before the change to prevent any data loss. 
- The volume can be re-created from that snapshot if needed. 
How to Install
Refer to the Runbook Setup Guide for steps to install and enable this runbook in your environment.
Runbook Workflow
Step 1: Start
Trigger: Begins the workflow to migrate EBS volumes from gp2 to gp3.
Step 2: DescribeVolumes
Action: Executes DescribeVolumes on EC2 to gather details of all volumes.
Step 3: setIOPS
Action: Runs a script to determine the appropriate IOPS value for the gp3 volume.
Step 4: If/Else
Condition: Determines whether the volume type is gp2.
- If the volume is gp2, proceeds with the migration steps: - SnapshotVolume Executes - CreateSnapshoton EC2 to create a backup of the volume.
- WaitForSnapshotCompletion Executes - DescribeSnapshotsto ensure the snapshot has completed.
- ModifyVolume Executes - ModifyVolumeon EC2 to convert the volume type to- gp3with the specified IOPS.
 
- Else: Terminates the runbook as the volume is not - gp2.
See How it Works

Triggering the Runbook
To run this workflow:
1. Locate the Ticket
Identify the ticket associated with the above mentioned policy violation.
2. Execute the Runbook
Follow the steps described in the executing a runbook section to apply this runbook to the ticket.
Last updated

