![]() Here is a simple bash script that you can use to change all gp2 volumes to gp3 volumes using the AWS CLI: #!/bin/bash #Get all the gp2 volumes GP2_VOLUMES=$(aws ec2 describe-volumes -filters "Name=volume-type,Values=gp2" -query 'Volumes.') #Loop through all the gp2 volumes for volume in $(echo $GP2_VOLUMES | jq -r '. aws ec2 modify-volume -volume-type gp3 -iops 4000 -throughput 250 -volume-id The following is an example command to modify a gp2 volume to gp3 and configure specific IOPS and throughput. Where is the Volume ID that you want to migrate to gp3. Use the modify-volume command so you migrate to gp3: aws ec2 modify-volume -volume-type gp3 -volume-id Use the describe-volumes command with the -filters option to get a list of all gp2 volumes: aws ec2 describe-volumes -filters "Name=volume-type,Values=gp2"Ģ. (Optional) Before modifying a volume that contains valuable data, it is a best practice to create a snapshot of the volume in case you need to roll back your changes.To select the right size and right performance parameters (IOPS, throughput) that can provide you maximum cost reduction without affecting performance, I recommend reviewing the IOPS and throughput suggested by Sibasankar Behera on his blog post.For example, if you modify a 500 GiB gp2 volume with 250 MiB/s throughput and 1500 IOPS to gp3 without specifying IOPS or throughput performance, Amazon EBS automatically provisions the gp3 volume with 3000 IOPS (baseline gp3 IOPS) and 250 MiB/s (to match the source gp2 volume throughput). If you change the volume type from gp2 to gp3, and you do not specify IOPS or throughput performance, Amazon EBS automatically provisions either equivalent performance to that of the source gp2 volume, or the baseline gp3 performance, whichever is higher. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |