StackZone Feature: EBS Optimizer
Introduced in v4.15.0 of StackZone
Ryan Ware
Last Update 2 jaar geleden
Amazon Elastic Block Storage (EBS)
This section will focus on Amazon EBS Volumes.
These Volumes are the SSD or HDD bases storage volumes which are attached to your Amazon EC2 Instances.
Click here to learn more about Amazon EBS Volumes, or here to see Amazon's FAQ on these resources.
StackZone EBS Optimizer
The StackZone EBS Optimizer is an automated feature which will has the ability to swap Amazon EBS Volumes from the older, more expensive general purpose2 (gp2) variant to the newer general purpose 3 (gp3) volume.
gp3 EBS Volumes offer SSD-performance at a 20% lower cost per GB than gp2 volumes. Furthermore, by decoupling storage performance from capacity, you can easily provision higher IOPS and throughput without the need to provision additional block storage capacity, thereby improving performance and reducing costs.
They are cheaper than the older gp2 volumes and come with some additional cost saving benefits, such as 3,000 IOPS free, before being charged on that aspect by AWS.
gp3 volumes take all the guesswork out of provisioning capacity and performance for your applications. You get sustained, baseline performance of 3,000 IOPS at any volume size. This means that even if you don’t provision any IOPS, your applications will consistently get this baseline performance for the smallest of volumes. For use cases where your application needs more performance than the baseline, you simply provision the IOPS or throughput you need, without having to add more capacity.
Tag Your Volumes
The StackZone EBS Optimizer will only upgrade your volumes to gp3 if you tag them; but before start tagging volumes, you need to enable the feature from StackZone Console first.
To enable this feature go to Provisioning -> Baseline Services -> Amazon Storage Optimizer. In order to make changes, we need to first enable the Edit mode. This can be done by clicking in the toggle switch located at the top-right corner, then enable the Amazon EBS Optimizer feature.
You can define your own tag key and value for this operation in your StackZone configuration. To show this, I will use the following Tag Key/Value's below
- Tag Key: optimize
- Tag Value: true
Once your tags are defined, click on Save Settings button then go to Provisioning -> Status and click on the Deploy button. Notice that the deployment process will take some time to finish from the AWS side.
With these parameters chosen and in place, we can start tagging your Amazon EBS Volumes to be upgraded!
Automation Execution
Once this Tag is in place, an Amazon EventBridge Rule will be triggered which will notify the automated document to run, which will automatically turn this Amazon EBS Volume from gp2 family, to gp3.
The Automation runs almost instantly, but please be aware of a potential time lock issue from changing the Amazon EBS Volume too many times in a short timeframe:
Automation can fail when it is executing action. ModifyVolume operation can only execute per volume once per 6 hours. Please refer to the Automation Service Troubleshooting Guide for more diagnosis details
Troubleshooting
Q: I Tagged My EBS Volume but it didn't upgrade to GP3 - Why?
First, we need to check that this StackZone feature is enabled from the StackZone User Interface before start tagging volumes. We should also check our chosen Tag Key and Tag Value.
If this is enabled, check that you have tagged your EBS Volume correctly using your chosen Tag Key and Tag Value.
Check that you have the correct Roles within your AWS Account. The StackSet which enables this feature should create an IAM Role in your account called "StackZone-SSMAutomation-Role-Region"
If this exists, check that this IAM Role has a Policy attached to it, called "ModifyVolumeTypePolicy"
The next place to check, is the AWS Systems Manager (SSM) Automations Page to check if we have any automated executions. To get here, head to the AWS Systems Manager (SSM) Dashboard in the AWS Console. From the left hand side menu, under Change Management, click on Automation
If the above execution is listed within your list of AWS Systems Manager (SSM) Automations - you are able to click this and view the details - which if this has failed may give insight as to why this failed.
If you do not see the execution listed here - you will need to check some additional resources to further understand why.
First, check that the SSM Automation Document exists. You can do this by going to the AWS Systems Manager (SSM) Dashboard > Documents and click on the "Owned By Me" Tab - Search for "ebsvolume" to narrow down the list - we should see a Document listed by the name of StackZone-ModifyEBSVolume listed here
Secondly, check that the EventBridge Events Rule which trigger this has been created. You can do this by heading to the Amazon EventBridge dashboard in the AWS Console, head to Rules and then search for "ebs" to narrow this down. You should be able to see and inspect a rule called EBS-Modifier-Rule. Check this rule has an Enabled status.
Q: How do I check my tagged EBS Volume has been upgraded to GP3?
- To check this, head to your EC2 Dashboard on the AWS Console, and ensure you are in the correct region, as EBS Volumes are region specific.
- Under the Elastic Block Store heading, choose Volumes.
- Click the Volume which you have already tagged
- Under the Details tab which is appears below the list of EBS Volumes, check the type - you should now see the type listed as gp3
Q: What happens if I tag my EBS Volume whilst my EC2 Instance is on?
The EC2 Instance and EBS Volume will continue to work as they are upgraded from gp2 to gp3.
There is no loss of connection or loss of data if you are working on these resources whilst you tag the EBS Volume to be upgraded.
Q: I modified my EBS Volume, why doesn't it let me do it again?
There is a limit on how often AWS lets it's customer call the ModifyVolume operation. We can only call this per volume once every 6 Hours.
Want to know more about StackZone and how to make your cloud management simple and secure?
Check our how it works section with easy to follow videos or just create your own StackZone Account here