- Newest
- Most votes
- Most comments
AWS DataSync does not directly support transferring data between EBS volumes. DataSync is designed to transfer data between specific storage resources such as Amazon EFS, Amazon FSx, Amazon S3, NFS, SMB, HDFS, and object storage systems.
For your scenario of maintaining data synchronization between two EC2 instances with EBS volumes for failover purposes, you would need to consider alternative approaches:
-
You could mount an Amazon EFS file system to both EC2 instances instead of using EBS volumes. EFS is designed for multi-AZ access and would provide shared storage accessible from both your primary and standby instances.
-
If you must use EBS volumes, you could implement application-level replication solutions like rsync or other third-party tools that can synchronize data between the EBS volumes of your EC2 instances.
-
Another option would be to create EBS snapshots of your primary instance's volume and restore them to the standby instance's EBS volume on a scheduled basis.
DataSync is particularly useful for transferring data between file systems in different AWS Regions or between file systems owned by different AWS accounts, but it doesn't support direct EBS-to-EBS transfers.
Sources
Where can I transfer my data with AWS DataSync? - AWS DataSync
Using AWS DataSync to transfer data - Amazon Elastic File System
AWS DataSync Discovery | Amazon Web Services
No. You cannot use AWS DataSync directly between two Amazon EBS volumes.
You must go through a mounted file system or use EBS snapshots
For production workloads, snapshots are the most reliable and AWS-native solution
No, AWS DataSync cannot be used directly between two EBS volumes.
AWS DataSync is designed for file and object storage such as Amazon S3, Amazon EFS, Amazon FSx, or NFS/SMB file servers. It does not support block storage, so you cannot use it to synchronize data directly from one EBS volume to another EBS volume.
In addition, EBS volumes are Availability Zone–specific. An EBS volume created in AZ 1a cannot be attached to an EC2 instance in AZ 1b, even within the same region and account.
Redesign with Multi-AZ Shared Storage (Recommended)
- Use Amazon EFS, which is natively Multi-AZ
- Mount the same EFS file system on both the primary and standby EC2 instances
- In a failure, the standby instance can immediately access the same data
Pros
- Simple failover
- No data synchronization needed
- AZ-resilient by design
Cons
- Requires your application to work with shared file storage (not raw block storage)
In short, AWS DataSync does not support block-level replication between EBS volumes. It operates at the file level, which means you can synchronize data by mounting each EBS volume to an EC2 instance and copying files between directories. However, this approach is not suitable for real-time failover scenarios.
If your goal is high availability or failover across Availability Zones, the following options are generally more appropriate:
- Amazon EFS: Natively supports Multi-AZ access and allows both EC2 instances to share the same data with minimal complexity.
- EBS snapshot–based recovery: Take regular snapshots and create a new volume in another AZ during recovery, suitable for disaster recovery use cases.
- AWS Elastic Disaster Recovery (DRS): Designed for continuous replication and fast recovery of EC2 workloads across AZs or Regions.
- Database-level replication: For database workloads, native replication mechanisms are preferred over DataSync.
In summary, AWS DataSync can be used for periodic file synchronization, but it is not the right tool for Active/Standby EBS-based failover between Availability Zones.
Relevant content
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 3 months ago
