AWS Blogs 10月15日
AWS EBS推出卷克隆功能,实现数据秒级复制
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

AWS 近期推出了 Amazon EBS Volume Clones 功能,允许用户在同一可用区内即时创建 EBS 卷的副本。此新功能简化了复制流程,用户只需通过单个 API 调用或控制台点击即可完成。与以往需要创建快照再从快照恢复卷的方式相比,Volume Clones 能够秒级提供可用副本,并具备单毫秒级别的低延迟,特别适合快速搭建包含生产数据的测试环境或为开发目的创建临时数据库副本。克隆卷在初始化过程中提供基础性能,初始化完成后则具备完整配置性能,且与源卷独立存在,但需注意仅支持加密卷,且副本大小需大于等于源卷。

✨ **即时卷复制,提升效率**:Amazon EBS Volume Clones 提供了一种全新的方式,可在同一可用区内快速创建 EBS 卷的即时副本。用户无需经历传统快照创建和恢复的多个步骤,只需通过简单的 API 调用或控制台操作,即可在数秒内获得一个可用的卷副本,极大地缩短了数据复制和环境搭建的时间。

🚀 **秒级可用,低延迟体验**:新创建的卷副本在几秒钟内即可使用,并提供单毫秒级别的低延迟访问。这使得 Volume Clones 非常适合需要快速启动包含生产数据的测试环境,或者为开发目的创建临时数据库副本的场景,确保开发和测试工作不受延迟影响。

🔒 **加密卷支持与大小限制**:目前,Volume Clones 功能仅支持加密卷的复制。此外,新创建的卷副本的大小必须等于或大于源卷的大小,以确保数据的完整性和兼容性。

🔄 **与快照互补,而非替代**:Volume Clones 生成的是崩溃一致性副本,类似于快照。但它主要用于测试和开发场景,而 EBS 快照仍是备份和数据保护的首选方案,提供更高的数据持久性和增量备份能力。Volume Clones 创建的副本独立于源卷,需要手动管理以避免不必要的成本。

💰 **成本与管理考量**:副本卷在创建后会产生标准的 EBS 卷费用,直至被删除。用户需要实施有效的治理规则来管理和清理不再需要的副本卷,以控制成本。

ATTENTION BLOG POST REVIEWERS—please note the following before beginning your review: (1) Focus your review on technical accuracy. (2) Provide comments. Do not try to rewrite the post, as that may result in your post being canceled. (3) Respect the writer's voice. If you see a typo or grammatical mistake, you can cite it, but decisions of word choice, style, and structure are at the writer's discretion. Thank you for respecting our production process.

As someone that used to work at Sun Microsystems, where ZFS was invented, I’ve always loved working with storage systems that offer instant volume copies for my development and testing needs.

Today, I’m excited to share that AWS is bringing similar capabilities to Amazon Elastic Block Store (Amazon EBS) with the launch of Amazon EBS Volume Clones, a new capability that lets you create instant point-in-time copies of your EBS volumes within the same Availability Zone.

Many customers need to create copies of their production data to support development and testing activities in a separate nonproduction environment. Until now, this process required taking an EBS snapshot (stored in Amazon Simple Storage Service (Amazon S3)) and then creating a new volume from that snapshot. Although this approach works, the process creates operational overhead due to multiple steps.

With Amazon EBS Volume Clones, you can now create copies of your EBS volumes with a single API call or console click. The copied volumes are available within seconds and provide immediate access to your data with single-digit millisecond latency. This makes Volume Clones particularly useful for quickly setting up test environments with production data or creating temporary copies of databases for development purposes.

Let me show you how Volume Clones works
For this post, I created a small Amazon Elastic Compute Cloud (Amazon EC2) instance, with an attached volume. I created a file on the root file system with the command echo "Hello CopyVolumes" > hello.txt.

To initiate the copy, I open a browser on the AWS Management Console and I navigate to EC2, Elastic Block Store, Volumes. I select the volume I want to copy.

Note that, at the time of publication of this post, only encrypted volumes can be copied.

On the Actions menu, I choose the Copy Volume option.

Next, I choose the details of the target volume. I can change the Volume type and adjust the Size, IOPS, and Throughput parameters. I choose Copy volume to start the Volume Clone operation.

The copied volume enters the Creating state and becomes available within seconds. I can then attach it to an EC2 instance and start using it immediately.

Data blocks are copied from the source volume and written to the volume copy in the background. The volume remains in the Initializing state until the process is complete. I can monitor its progress with the describe-volume-status API. The initializing operation doesn’t affect the performance of the source volume. I can continue using it normally during the copy process.

I love that the copied volume is available immediately. I don’t need to wait for its initialization to complete. During the initialization phase, my copied volume delivers performance based on the lowest of: a baseline of 3,000 IOPS and 125 MiB/s, the source volume’s provisioned performance, or the copied volume’s provisioned performance.

After initialization is completed, the copied volume becomes fully independent of the source volume and delivers its full provisioned performance.

Alternatively, I can use the AWS Command Line Interface (AWS CLI) to initiate the copy:

aws ec2 copy-volumes                          \     --source-volume-id vol-1234567890abcdef0 \     --size 500                               \     --volume-type gp3

After the volume copy is created, I attach it to my EC2 instance and mount it. I can check the file I created at start is present.

First, I attach the volume from my laptop, using the attach-volume command:

aws ec2 attach-volume \         --volume-id 'vol-09b700e3a23a9b4ad' \         --instance-id 'i-079e6504ad25b029e'   \         --device '/dev/sdb'

Then, I connect to the instance, and I type these commands:

$ sudo lsblk -fNAME          FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTSnvme0n1                                                                              ├─nvme0n1p1   xfs          /     49e26d9d-0a9d-4667-b93e-a23d1de8eacd    6.2G    22% /└─nvme0n1p128 vfat   FAT16       3105-2F44                               8.6M    14% /boot/efinvme1n1                                                                              ├─nvme1n1p1   xfs          /     49e26d9d-0a9d-4667-b93e-a23d1de8eacd                └─nvme1n1p128 vfat   FAT16       3105-2F44     $ sudo mount -t xfs /dev/nvme1n1p1 /data$ df -hFilesystem        Size  Used Avail Use% Mounted ondevtmpfs          4.0M     0  4.0M   0% /devtmpfs             924M     0  924M   0% /dev/shmtmpfs             370M  476K  369M   1% /run/dev/nvme0n1p1    8.0G  1.8G  6.2G  22% /tmpfs             924M     0  924M   0% /tmp/dev/nvme0n1p128   10M  1.4M  8.7M  14% /boot/efitmpfs             185M     0  185M   0% /run/user/1000/dev/nvme1n1p1    8.0G  1.8G  6.2G  22% /data$ cat /data/home/ec2-user/hello.txt Hello CopyVolumes

Things to know
Volume Clones creates copies within the same Availability Zone as your source volume. You can create copies from encrypted volumes only, and the size of your copy must be equal to or greater than the source volume.

Volume Clones creates crash-consistent copies of your volumes, exactly like snapshots. For application consistency, you need to pause application I/O operations before creating the copy. For example, with PostgreSQL databases, you can use the pg_start_backup() and pg_stop_backup() functions to pause writes and create a consistent copy. At the operating system level on Linux with XFS, you can use the xfs_freeze command to temporarily suspend and resume access to the file system and ensure all cached updates are written to disk.

Although Volume Clones creates point-in-time copies, it complements rather than replaces EBS snapshots for backup purposes. EBS snapshots remain the recommended solution for data backup and protection against AZ-level and volume failures. Snapshots provide incremental backups to Amazon S3 with 11 nines of durability, compared to Volume Clones which maintains EBS volume durability (99.999% for io2, 99.9% for other volume types). Consider using Volume Clones specifically for test and development environment scenarios where you need instant access to volume copies.

Copied volumes exist independently of their source volumes and continue to incur standard EBS volume charges until you delete them. To manage costs effectively, implement governance rules to identify and remove copied volumes that are no longer needed for your development or testing activities.

Pricing and availability
Volume Clones supports all EBS volume types and works with volumes in the same AWS account and Availability Zone. This new capability is available in all AWS commercial Regions, selected Local Zones, and in the AWS GovCloud (US).

For pricing, you’re charged a one-time fee per GiB of data on the source volume at initiation and standard EBS pricing for the new volume.

I find Volume Clones particularly valuable for database workloads and continuous integration (CI) scenarios. For instance, you can quickly create a copy of your production database for testing new features or troubleshooting issues without impacting your production environment or waiting for data to hydrate from Amazon S3.

To get started with Amazon EBS Volume Clones, visit the Amazon EBS section on the console or check out the EBS documentation. I look forward to hearing how you use this capability to improve your development workflows.

— seb

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

AWS Amazon EBS Volume Clones 数据复制 存储 开发测试 Instant Volume Copying Storage DevOps
相关文章