If you want to ensure a high level of performance for your EBS volumes, pairing them with EBS-optimized instances is a smart move. You’ll see EBS volumes deliver at least 90% of their provisioned IOPS performance 99.9% of the time.
EC2 instances with EBS optimization enabled utilize an optimized configuration stack with additional, dedicated capacity for Amazon EBS I/O. This set up reduces potential disruptions between other traffic from your instance and Amazon EBS I/O.
In this guide, we’ll show you how to find your instance types that support EBS optimization but do not have it enabled. After that, we’ll explain how to enable it.
Instances Without EBS Optimization Enabled by Default
Current generation instance types have EBS optimization enabled by default at an hourly usage fee, with no additional hourly cost for enabling optimization.
If you are running some previous generation instance types, they might support EBS-optimization but charge an hourly price for EBS optimization in addition to the hourly usage fee. If high performance is important for your use case, this additional charge to enable EBS optimization may be worth it.
Below is the list of EBS instance types that are not optimized by default but support it:
- c3.xlarge, c3.2xlarge, c3.4xlarge
- i2.xlarge, i2.2xlarge, i2.4xlarge
- m1.large, m1.xlarge
- m2.2xlarge, m2.4xlarge
- m3.xlarge, m3.2xlarge
- r3.xlarge, r3.2xlarge, r3.4xlarge
You can query your instances in a certain region to see if any support EBS optimization but don’t have it enabled by default. You can do that by running this modified describe-instance-types command in AWS CLI:
Here’s an example output from the na-east-1 region:
Here you can describe attributes for your EBS instance types offered in a location. Also, use filters to narrow your search to only those instances supporting EBS optimization. The output will be shown in the form of a table.
Enabling EBS Optimization on Existing Instances
You can use the AWS Console or CLI to enable EBS optimization by setting attributes for existing EBS instances. If the instance is running, you’ll have to stop it.
But remember to create a backup of your instance to persistent storage. Otherwise, stopping the instance will erase data from instance store volumes.
Using AWS Console:
Follow the steps below to enable existing EBS-optimized instances using AWS Console:
1. Open to the Amazon EC2 Console.
2. You’ll need to stop the running instance you want to update. Choose Instances from the navigation menu and select the instance you want to stop.
3. Select Actions > Instance state > Stop instance. Wait a few minutes for the instance to stop.
4. Next, choose Actions > Instance settings > Change instance type with the instance still selected.
5. To Change instance type, follow one of the steps below:
- If your chosen instance is EBS-optimized by default, the EBS-optimized option will be already selected and uneditable. There’s no action to take.
- If your chosen instance is not EBS-optimized by default but supports it, you can select EBS-optimized and Apply.
- If your chosen instance does not support EBS optimization, you won’t see it as an option. You can instead change the Instance type to one that supports EBS optimization, select EBS-optimized, then Apply.
6. To start the updated instance, click Instance state and Start instance.
Using AWS CLI:
Follow the steps below to enable existing EBS-optimized instances using AWS CLI:
1. Stop the running instance by using the following stop-instances command:
2. Next, enable EBS optimization by running the modify-instance-attribute command:
You won’t see any output from running this command.
3. Now that you have updated your instance, you can run the start-instances command:
Now you’ve successfully enabled EBS optimization for an existing instance. You can repeat these steps as needed.
Enabling EBS Optimization on New Instances
Using AWS Console
Follow the steps below to enable new EBS-optimized instances using AWS Console:
1. Open Amazon EC2 Console on your browser and select Launch instance.
2. Next, select an Amazon Machine Image (AMI) and then choose an instance type that supports EBS optimization. You can see a full list of types here.
3. Complete the required fields in Configure instance details and select Launch as EBS-optimized instance. If you don’t see this option, the instance type you selected doesn’t support EBS optimization. If your chosen instance type is optimized by default, this option will already be selected and cannot be changed.
4. Complete the wizard and launch your new EBS-optimized instance.
Using AWS CLI
To enable the EBS-optimized setting for new instances, you can do it with the --ebs-optimized flag when running a run-instances CLI command:
Here’s an example:
In the output, you’ll see the following line as a confirmation:
Checking for EBS Optimization with Blink
While running the command and clicking through the EC2 console isn’t hard, it requires context-switching and a lot of manual work depending on your use case. Ensuring that you have EBS optimization enabled on all EC2 instances would require you checking all regions and making manual updates.
With Blink, you can use no-code automations to quickly check across regions for instances without EBS optimization enabled and take action. It’s never been easier to implement a best practice across your cloud.
Create your free Blink account and optimize performance across your EC2 instances today.