aws - ebs

最後更新: 2023-12-22

目錄

  • ...
  • AWS EBS Multi-Attach

Keep the attached EBS volumes when I terminate an instance

 

When an instance is terminated, Amazon EC2 uses the value of the DeleteOnTermination attribute for each attached EBS volume

  to determine whether to preserve or delete the volume when the instance is terminated.

By default, the DeleteOnTermination attribute for the root volume of an instance is set to true, but it is set to false for all other volume types.

Changing the root volume of a running instance to persist using the command line (only cli can do this)

 


Deleting an Amazon EBS volume

 

Before deletion, you can store a snapshot of the volume,

which you can use to re-create the volume later

 


gp2 vs io2

 

Max. IOPS(16 KiB I/O)

  • gp2: 100~16,000

Vol < 33.33 GB = 100 IO/s

Vol > 33.33 GiB = Provisioned with 3 IOPS per GiB of volume size up 16,000 IOPS(max)

  • io2: 64,000

Burst

  • gp2 burst to 3000 IOPS (需要消耗 I/O credits)

volumes < 1 TiB 才用到此功能, 因為 1TiB 本身已經有 3000 IOPS

Earn I/O credits

When I/O demand drops to baseline performance level or lower => at a rate of 3 I/O credits per GiB

Volumes have an I/O credit accrual limit of 5.4 million I/O credits(burst at least 30 minutes)

Max. throughput

  • gp2:
    x < 170GiB                       # 128 MiB/s (max.)
    170 GiB <= x < 334 GiB    # 250 MiB/s (max.)
    x >= 334 GiB                   # 250 MiB/s (min size for max throughput)
  • io2: 1,000 MiB/s @ 64,000 IOPS

Throughput in MiB/s = IOPS performance × I/O size in KiB

 


Provisioned IOPS (PIOPS)

 

For EBS volumes you can specify a consistent IOPS rate when you create the volume.

 


gp2 vs gp3

 

Price@2023-03@HK

  • gp3 = $0.1056/GB-month
  • gp2 = $0.132/GB-month

 * 相當於 20% discount

gp3

  • 3,000 IOPS free and $0.0066/provisioned IOPS-month over 3,000
  • 125 MB/s free and $0.053/provisioned MB/s-month over 125

將 gp2 轉成 gp3

aws ec2 modify-volume -volume-id vol-XXXXXXXXX -volume-type gp3

 * without detaching volumes or restarting instances( no interruptions to your applications )

轉時 GUI 會見到

Volume state: In-use - optimizing(n%)

EBS Snapshots Storage Pricing    

  • Standard    $0.055/GB-month

Amazon EBS Multi-attach

attach io1 or io2 volume to multiple instances
(in the same Availability Zone)

 


AWS EBS Multi-Attach

 

Limitations of EBS Multi-Attach:

  • Share a single EBS volume for up to 16 instances
  • instances in the same availability zone
  • Multi-Attach is supported exclusively on Provisioned IOPS SSD (io1 or io2) volumes.
  • Multi-Attach enabled volumes can’t be created as boot volumes.
  • You can enable or disable Multi-Attach after "io2" volume creation.
  • (non-attached to an instance)
  • You can change the size, or Provisioned IOPS of a Multi-Attach enabled "io2" volume.
  • You can’t change the volume type(io1 -> io2).
  • OS must support a cluster file system, such as the Microsoft Cluster Shared Volume (CSV)
  • Multi-Attach enabled io2 volumes support I/O fencing.
  • (Multi-Attach enabled io1 volumes do not support I/O fencing.)

io2 pricing

  • $0.1518/GB-month
  • $0.079/provisioned IOPS-month up to 32,000 IOPS

 

Creative Commons license icon Creative Commons license icon