> For the complete documentation index, see [llms.txt](https://docs.onelens.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onelens.cloud/automate/remediations/remediations-runbooks/runbook-catalog/migrate-ebs-volumes-from-gp2-to-gp3.md).

# 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

| Detail                   | Value     |
| ------------------------ | --------- |
| **Risk Level**           | Low       |
| **AWS Service Targeted** | EC2 / EBS |

{% hint style="warning" %}

## 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.
> {% endhint %}

## Optimization Policies Addressed

This runbook remediates violation tickets triggered by of the following policy:

| Policy ID | Policy Name                                              |
| --------- | -------------------------------------------------------- |
| ebs\_1    | General purpose EBS volumes should be of gp3 volume type |

## Risk Mitigation

{% hint style="success" %}

## 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.
  {% endhint %}

## How to Install

Refer to the [Runbook Setup Guide ](/automate/remediations/remediations-runbooks/install-runbooks.md#installing-a-runbook)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`.

1. **If the volume is gp2, proceeds with the migration steps:**
   1. **SnapshotVolume**\
      Executes `CreateSnapshot` on EC2 to create a backup of the volume.
   2. **WaitForSnapshotCompletion**\
      Executes `DescribeSnapshots` to ensure the snapshot has completed.
   3. **ModifyVolume**\
      Executes `ModifyVolume` on EC2 to convert the volume type to `gp3` with the specified IOPS.
2. **Else:**\
   Terminates the runbook as the volume is not `gp2`.

## See How it Works

<figure><img src="https://3963693991-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiyNGpqVYfmDF6qt7Lzar%2Fuploads%2FtEvldbKBpzI8c21WsHjU%2FScreenshot%202025-05-13%20at%2015.14.25.png?alt=media&amp;token=9d5d269b-38ac-4893-9108-972c5bd9e633" alt=""><figcaption></figcaption></figure>

## 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](/automate/remediations/remediations-runbooks.md#executing-a-runbook) section to apply this runbook to the ticket.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.onelens.cloud/automate/remediations/remediations-runbooks/runbook-catalog/migrate-ebs-volumes-from-gp2-to-gp3.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
