Skip to content

Can I use AWS Datasync between two EBS volumes

1

I have two EC2 instance each with its own EBS volume, my first EC2 instance is my primary and my secondary/standby EC2 instance is my second one, I would like to failover to my secondary/standby EC2 instance if something happens to my primary EC2 instance, also I have my primary EC2 instance in availability zone 1A and my secondary/standby EC2 instance in availability zone 1B in the same region, same account.

4 Answers
1

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:

  1. 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.

  2. 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.

  3. 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

answered 14 days ago
EXPERT
reviewed 13 days ago
1

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

answered 13 days ago
1

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)
answered 12 days ago
0
Accepted Answer

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.

answered 12 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.