Amazon EBS Multi-AZ volumes
A multi-AZ volume is an Amazon EBS volume that synchronously replicates your data across two Availability Zones in the same AWS Region. It consists of an active replica in the active Availability Zone and a standby replica in the standby Availability Zone.
With synchronous replication, Amazon EBS acknowledges each write to your application only after it stores the write on both the active replica and the standby replica. This behavior achieves a recovery point objective (RPO) of zero, keeping the standby replica current with every acknowledged write.
Your instance reads from and writes to the active replica. The standby replica does not support I/O operations until you fail over to it.
You can fail over to the standby Availability Zone for scheduled maintenance or in response to an unexpected Availability Zone disruption. Failover is designed to complete in under 10 seconds, 99% of the time.
How Multi-AZ volumes work
A multi-AZ volume has a single volume ID and works with the standard Amazon EBS volume APIs, with the exceptions listed in Considerations and limitations.
A multi-AZ volume does not need an instance in the standby Availability Zone, because Amazon EBS replicates your data to the standby replica entirely within the Amazon EBS layer, independent of any instance. However, you can optionally attach the volume to a running or stopped Amazon EC2 instance in the standby Availability Zone in advance, using the same volume ID. The standby instance can see the device, but you cannot read from, directly write to, or mount a file system on the standby replica until you fail over. Attaching an instance in advance simplifies your failover workflow, because the volume is already attached and you don't need to attach it after you fail over. After the failover, you mount the file system and start your application on the standby instance to resume operations. Because the application now runs on a different instance, redirect client traffic to it, for example by updating DNS. If you don't attach an instance in advance, you launch an instance in the standby Availability Zone and attach the volume to it after you fail over.
You create a multi-AZ volume by specifying a multi-AZ configuration, including the standby Availability Zone, when you create the volume. For more information, see Create a Multi-AZ volume.
The following diagram shows a multi-AZ volume across its active and standby Availability Zones, including an optional standby instance.
Supported volume types and instances
Multi-AZ is available for General Purpose SSD (gp3) and Provisioned IOPS SSD (io2) volumes. You can enable multi-AZ on both boot volumes and data volumes.
You can attach multi-AZ volumes to most Nitro-based Amazon EC2 instances. Some Nitro instance families don't support multi-AZ volumes; for the list, see Considerations and limitations. You can attach up to 64 multi-AZ volumes to a single instance, subject to the instance type's volume attachment limit.
You can attach both single-AZ and multi-AZ volumes to the same instance.
If you attach more than one multi-AZ volume to an instance, the volumes do not need to use the same standby Availability Zone. We recommend that you use the same standby Availability Zone for all of them, so that your data is together in one Availability Zone after failover.
Create a Multi-AZ volume
You enable multi-AZ only when you create a volume by specifying a multi-AZ configuration, including the active Availability Zone and one standby Availability Zone. You can create a multi-AZ volume with the CreateVolume API, or at instance launch with RunInstances by including the multi-AZ configuration in the block device mapping. We recommend that you specify Availability Zone IDs rather than names, because Availability Zone IDs are consistent across AWS accounts. For the request parameters, see CreateVolume and RunInstances in the Amazon EC2 API Reference.
To convert an existing single-AZ volume to a multi-AZ volume, create a snapshot of the volume, and then create a multi-AZ volume from the snapshot. You can't convert a volume in place by using ModifyVolume.
Performance
A multi-AZ volume has higher write latency than a single-AZ volume, because Amazon EBS synchronously replicates each write to the standby Availability Zone. Its write latency is approximately the write latency of an equivalent single-AZ volume, plus the network round trip between the active and standby Availability Zones and a small amount of replication overhead. Read latency is comparable to a single-AZ volume, because Amazon EBS serves reads from the active replica.
Because of the higher write latency, the achievable write IOPS of a multi-AZ volume can be lower than for a single-AZ volume. The maximum achievable write IOPS is approximately your application's queue depth divided by the write latency. For example, to achieve 10,000 write IOPS at 900 microseconds of write latency, you need a queue depth of at least 9. The achievable IOPS is also capped by the minimum of the multi-AZ volume's provisioned IOPS and what the instance can support. A multi-AZ volume has one IOPS setting that applies to both reads and writes. For gp3 volumes, it also has one throughput setting that applies to both reads and writes. Set each setting to meet your peak combined read and write requirement. If a single multi-AZ volume can't meet your performance needs, you can stripe several multi-AZ volumes together. If several multi-AZ volumes form one striped set or hold data for one application, use the same standby Availability Zone for all of them. Fail them over together with an instance-level failover. Otherwise, after a failover the set can be split across Availability Zones.
The inter-Availability Zone latency is not the same for every Availability Zone pair in a Region. To compare pairs, use the inter-Availability Zone latency metric in Infrastructure performance in the AWS Network Manager User Guide, which provides the P50 (median) network round trip. Choose the pair that meets your latency needs.
You can use this P50 round trip to estimate the write latency of a multi-AZ volume, by adding it to the single-AZ write latency of the volume. For example, for an Availability Zone pair with a median round-trip latency of 400 microseconds and an io2 volume, which as a single-AZ volume has an average write latency under 500 microseconds1, the estimated multi-AZ write latency is at least 900 microseconds. Because the network round trip is a median, actual write latency varies and can be higher than the estimate. Before you use multi-AZ in production, benchmark it with a workload that represents your application, and design your application to tolerate write latency above your benchmark results.
1 A single-AZ io2 volume is designed to deliver an average latency of under 500 microseconds for 16KiB I/O operations.
Monitor Multi-AZ volumes
You can monitor a multi-AZ volume's performance the same way as for any other Amazon EBS volume, by using CloudWatch metrics, the DescribeVolumeStatus API, and Amazon EBS detailed performance statistics on the instance. For a multi-AZ volume, write latency includes the inter-Availability Zone round trip of synchronous replication to the standby Availability Zone.
In addition, a multi-AZ volume reports status values that are specific to multi-AZ: the replication data state, the failover readiness, and, while replication is catching up, the catch-up progress and total. Each channel names and encodes these values differently.
-
The replication data state reports the state of data replication between the active and standby replicas. The value can be:
in-sync– The standby replica holds the same data as the active replica.catching-up– Replication has resumed and is catching up on data that was written to the active replica while the volume was out of sync.out-of-sync– Replication has stopped.insufficient-data– There is not enough data to determine the state, such as for a newly created or recently attached volume.
While the state is
catching-up,CatchupProgressreports the percentage of that data that has been replicated, from 0 to 100, andCatchupTotalBytesreports the total number of bytes that must be replicated to the standby replica. -
The failover readiness reports whether the volume is ready to fail over to its standby Availability Zone. The value can be:
ready– The volume is ready to fail over to its standby Availability Zone.not-ready– The volume is not ready to fail over, for example because the standby replica is behind the active replica or the standby Availability Zone is unhealthy.insufficient-data– There is not enough data to determine readiness, such as for a newly created or recently attached volume.
Failover readiness reflects both the health of the standby Availability Zone infrastructure and the data replication state. This value is based on the most recent metric view and might not reflect the real-time state. Amazon EBS evaluates readiness at the moment you call
FailoverVolumesand rejects the request with aFailoverNotReadyerror if the volume isn't ready to fail over. TheFailoverVolumesDryRunoption checks only whether you're authorized to call the action, not failover readiness. CallFailoverVolumesonly when you intend to fail over.
The following table shows, for each status value, the field, metric, or log field that each channel reports.
| Status value | DescribeVolumeStatus field |
CloudWatch metric (value) | NVMe log field |
|---|---|---|---|
| Replication data state | ReplicationDataState: in-sync, catching-up, out-of-sync, insufficient-data |
VolumeReplicationDataState: 0 (in-sync), 1 (catching-up), 2 (out-of-sync) |
replication_data_state: 0 (in-sync), 1 (catching-up), 2 (out-of-sync) |
| Failover readiness | FailoverReadiness: ready, not-ready, insufficient-data |
VolumeFailoverReadiness: 0 (ready), 1 (not-ready) |
failover_readiness: 0 (ready), 1 (not-ready) |
| Catch-up progress and total | CatchupProgress, CatchupTotalBytes |
Not published | Not reported |
On CloudWatch, the insufficient-data state appears as missing data, with no datapoint, rather than a numeric value. The CloudWatch metrics use the VolumeId dimension only. CatchupProgress and CatchupTotalBytes are available only from the DescribeVolumeStatus API.
The multi-AZ status fields, replication_data_state and failover_readiness, are reported on a separate NVMe log page. Read this page from the NVMe controller device, for example /dev/nvme1, not the namespace device, for example /dev/nvme1n1. If you try to read the page from the namespace device, the read fails with a No such device or address error. The volume_attachment_health_check field is reported with the Amazon EBS performance statistics, not on the multi-AZ status log page. For the performance statistics, see Amazon EBS detailed performance statistics. For the multi-AZ status log page ID and the command to read it, see Multi-AZ volume status fields. If you attach an instance in the standby Availability Zone in advance, you can also read the multi-AZ status log page from that standby instance.
Before you fail over, you can check two factors to determine whether your instance will be able to perform I/O after the failover: the volume's failover readiness, and the health of the connection between the instance and the volume. You can monitor the instance-to-volume connection health with the StatusCheckFailed_AttachedEBS CloudWatch metric, an instance-level check that reports whether one or more of the Amazon EBS volumes attached to the instance are not reachable, or with the volume_attachment_health_check field, a volume-level check that reports the health of the volume attachment. For more information about the attached EBS status check, see Status checks for Amazon EC2 instances in the Amazon EC2 User Guide.
Failover
When you fail over, Amazon EBS promotes the standby replica to the active replica and swaps the active and standby Availability Zones. You start a failover by calling the FailoverVolumes API. For more information about FailoverVolumes, see the Amazon EC2 API Reference. Amazon EBS does not automatically fail over from the active Availability Zone to the standby Availability Zone. You might fail over for scheduled maintenance or in response to an unexpected Availability Zone disruption, and failover is designed to complete in under 10 seconds, 99% of the time.
You can fail over a single volume, or fail over all of the multi-AZ volumes attached to an instance that have their active replica in the instance's Availability Zone. An instance-level failover is crash-consistent across the volumes, and either all of them fail over or none do. An instance-level failover skips any attached volume whose active replica is not in the instance's Availability Zone. A single-volume request by VolumeId for such a volume fails. You can fail over a multi-AZ volume when its standby replica is healthy and current, so that it can serve I/O after the failover. Amazon EBS checks readiness when you call FailoverVolumes and rejects the request with a FailoverNotReady error if the standby replica can't take over. A standby replica that is behind the active replica (for example, while ReplicationDataState is out-of-sync or catching-up) isn't ready to fail over. Use FailoverReadiness as guidance beforehand.
You can monitor two kinds of signal to decide when to fail over:
Volume signals. You can use any volume-level performance signal, such as stalled I/O. Monitor these signals with the methods described in Monitor Multi-AZ volumes. These signals are per-volume; other volumes on the same instance might be healthy.
Availability Zone signals. Amazon Application Recovery Controller (ARC) zonal autoshift provides observer notifications that indicate when an Availability Zone is experiencing a large-scale event. For more information, see Zonal autoshift in the Amazon Application Recovery Controller (ARC) Developer Guide.
FailoverVolumes is not a readiness check. Calling it performs the failover, and its DryRun option checks only whether you're authorized to call the action. Call FailoverVolumes only when you intend to fail over.
Monitor failover
After you call FailoverVolumes, you can confirm that the failover completed in two ways:
DescribeVolumes – The volume's active and standby Availability Zones have swapped. This is the fastest way to confirm that the failover completed.
Amazon EventBridge – Amazon EBS sends an
EBS Failover Notificationevent to Amazon EventBridge. The event reports a status ofcompletedwhen the failover finished and the Availability Zones have swapped, orstalledif the failover did not complete within 2 minutes. Astalledstatus doesn't mean the failover stopped; Amazon EBS continues to retry, so confirm the outcome withDescribeVolumes. These notifications can take a few minutes to arrive. For an example event, see EBS multi-AZ volume failover event.
You can use the EventBridge event to trigger automated responses, such as notifying your operations team.
Standby Availability Zone problems
If the standby replica, the standby Availability Zone, or the replication link has a problem, your volume stays available. Your instance continues to read from and write to the active replica, and Amazon EBS continues to store your writes durably in the active Availability Zone.
Amazon EBS stops replicating to the standby replica, and the volume's ReplicationDataState changes to out-of-sync. During the transition, you might observe paused I/O, typically for up to about 60 seconds.
Amazon EBS automatically resumes replication when the standby recovers. If the standby cannot recover, Amazon EBS rebuilds the standby replica. Rebuilding and catch-up are performed on a best-effort basis. As a general guideline, replicating the first 1 TiB of data takes up to 6 hours, each additional TiB up to 16 TiB takes about 1.2 hours per TiB, and data larger than 16 TiB takes up to 24 hours. As the standby catches up on the writes made to the active replica while replication was stopped, ReplicationDataState changes to catching-up, and then to in-sync when the replicas are synchronized. Until the standby replica has caught up, it is behind the active replica and isn't ready to fail over.
Change the standby Availability Zone
You can use ModifyVolume to change the standby Availability Zone of a multi-AZ volume. For example, after you fail over because of an Availability Zone disruption, your standby replica is now in the Availability Zone that was disrupted. To regain resiliency across two healthy Availability Zones, change the standby Availability Zone to a healthy one.
To change it, specify the new standby Availability Zone in the ModifyVolume request. Amazon EBS replicates the existing written data to the new standby replica on a best-effort basis, and it synchronously replicates new writes to the new standby replica. As a general guideline, replicating the first 1 TiB of data takes up to 6 hours, each additional TiB up to 16 TiB takes about 1.2 hours per TiB, and data larger than 16 TiB takes up to 24 hours. You can't fail over the volume while Amazon EBS is replicating to the new standby Availability Zone. FailoverVolumes is rejected with a FailoverNotAllowed error until catch-up completes, so plan the change for a time when you don't expect to need a failover. While Amazon EBS is replicating data to the new standby Availability Zone, the volume's ReplicationDataState is catching-up.
You can track the total amount of data to copy to the new standby replica and the progress of the copy with the CatchupTotalBytes and CatchupProgress values from DescribeVolumeStatus. You can also track the overall modification with DescribeVolumesModifications. For more information, see Monitor the progress of Amazon EBS volume modifications.
Changing the standby Availability Zone is a billed operation. Amazon EBS charges for the data that it replicates to the new standby replica, which is the amount of data written on the active replica when the modification begins.
If the standby replica is attached to an instance, you must detach it first. Otherwise, ModifyVolume is rejected. You can detach it by calling DetachVolume. Specify the instance ID of the instance in the standby Availability Zone. A multi-AZ volume can have one attachment in each Availability Zone under the same volume ID, so the instance ID selects which attachment DetachVolume removes.
ForceDetachStandby is a member of the multi-AZ configuration (MultiAvailabilityZoneConfiguration) in the ModifyVolume request, not a top-level parameter. Set it to true to skip the standby-attachment check in every case. Use it when the standby Availability Zone is unavailable and you can't detach the standby replica with DetachVolume. For more information, see ModifyVolume in the Amazon EC2 API Reference.
If you force-detach because the standby Availability Zone is unavailable, DescribeInstances for the instance in the old standby Availability Zone might still show the multi-AZ volume as attached. This can happen even though the standby replica has moved to the new Availability Zone. When the old standby Availability Zone becomes available again, the attachment metadata becomes current, and the volume no longer appears as attached to that instance.
When you change the standby Availability Zone, the destination Availability Zone must have Amazon EBS capacity for the new standby replica. If sufficient capacity is not available, the modification fails. Check the state of the modification by using DescribeVolumesModifications.
Plan for Amazon EC2 capacity in the new standby Availability Zone. If you later perform a failover, the standby Availability Zone becomes the active Availability Zone, and your workload runs on an Amazon EC2 instance there. That instance requires Amazon EC2 capacity in the new active Availability Zone, and Amazon EC2 capacity is not guaranteed unless you reserve it, for example with an On-Demand Capacity Reservation.
As a best practice, provision your redundancy ahead of time and treat a standby Availability Zone change as a planned configuration change, not something you do reactively during a disruption when capacity is least likely to be available. For more information, see Use static stability to prevent bimodal behavior in the AWS Well-Architected Framework.
Snapshots of Multi-AZ volumes
You create snapshots of a multi-AZ volume the same way you do for a single-AZ volume, by using CreateSnapshot or CreateSnapshots. Amazon EBS creates the snapshot from the active Availability Zone. A snapshot that you take after a failover is incremental to the snapshots that you took before the failover, so it captures only the blocks that changed.
Snapshots and AMIs created from a multi-AZ volume don't retain the multi-AZ configuration. When you create a volume from such a snapshot, it's a single-AZ volume unless you specify a multi-AZ configuration in the CreateVolume request. Similarly, when you launch an instance from such an AMI, its volumes are single-AZ unless you specify a multi-AZ configuration in the block device mapping of the RunInstances request.
CreateSnapshots and CreateImage act on all of the volumes attached to the instance that you specify. If a multi-AZ volume is attached to that instance, its active replica must be in the instance's Availability Zone, because Amazon EBS creates snapshots only from the active replica. If instead the standby replica is the one attached to the instance, the request fails with an InstanceVolumeActiveAvailabilityZoneMismatch error, which is non-retryable. To exclude the volume, for CreateSnapshots specify it in ExcludeDataVolumeIds. For CreateImage, specify NoDevice for the volume's device in the block device mapping. You can't exclude the volume this way if the standby replica is the instance's root volume.
After a failover, the active and standby Availability Zones swap. If you call CreateSnapshots or CreateImage on the instance in the Availability Zone that was active before the failover, the multi-AZ volume's standby replica is now attached to that instance, so these calls fail. Call CreateSnapshots and CreateImage from the instance in the current active Availability Zone instead.
CreateSnapshot and CreateSnapshots fail with a VolumeFailoverInProgress error while a failover is in progress. This error is retryable, so automation can retry after the failover completes.
To automatically create snapshots of your multi-AZ volumes, use an Amazon Data Lifecycle Manager MultiAvailabilityZone policy. The policy creates a snapshot of each multi-AZ volume in the Region every 15 minutes and keeps only the most recent snapshot of each volume. You can optionally enable cross-Region copy to copy each snapshot to other Regions. For more information, see Create Amazon Data Lifecycle Manager MultiAvailabilityZone policies.
Amazon Data Lifecycle Manager policies that target volumes (the default Amazon EBS snapshot policy and custom snapshot policies that target volumes) back up multi-AZ volumes the same way as any other volume, with no special handling.
Policies that snapshot the volumes attached to an instance, or that create AMIs, are the default and custom EBS-backed AMI policies and custom snapshot policies that target instances. As with CreateSnapshots and CreateImage, these policies create snapshots only from the active replica, so a multi-AZ volume's active replica must be in the targeted instance's Availability Zone. After a failover, the active and standby Availability Zones swap. If the policy targets the instance in the Availability Zone that was active before the failover, the volume's standby replica is now attached to that instance, so the policy can't snapshot or create an AMI from it. Target the instance in the current active Availability Zone instead.
Control access with IAM
You can control who can create and operate on multi-AZ volumes by using the ec2:MultiAzConfigurationType condition key in your IAM policies. The value of the condition key is the multi-AZ configuration type, multi-az-1. AWS evaluates this condition key on API actions that involve volumes, including CreateVolume, ModifyVolume, CreateSnapshot, CreateSnapshots, AttachVolume, DetachVolume, and FailoverVolumes.
Authorization behavior
The following table describes the IAM authorization behavior for key multi-AZ volume actions.
| Action | IAM behavior |
|---|---|
CreateVolume |
You need permission to create the volume in both the active and the standby Availability Zone. |
FailoverVolumes |
You need permission on the volume and on the instances in the active and standby Availability Zones. For an instance-level failover, you need permission on all of the attached multi-AZ volumes and on the standby instance. |
AttachVolume, ModifyVolume, CreateSnapshot |
AWS evaluates the ec2:MultiAzConfigurationType condition key as part of standard volume authorization. |
The ec2:AvailabilityZone and ec2:AvailabilityZoneId condition keys accept a list of values. If your policy scopes permissions to specific Availability Zones, include the volume's current active and standby Availability Zones, and also any Availability Zone that you might change the standby to in the future with ModifyVolume. If you change the standby Availability Zone in response to a disruption or as a planned change, your policy must already permit that Availability Zone, or ModifyVolume is denied.
Example: allow only multi-AZ volume creation
The following identity-based policy allows the creation of multi-AZ volumes only.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "ec2:CreateVolume", "Resource": "arn:aws:ec2:us-east-1:123456789012:volume/*", "Condition": { "StringEquals": { "ec2:MultiAzConfigurationType": "multi-az-1" } } } ] }
Example: deny multi-AZ volume creation
The following identity-based policy denies the creation of multi-AZ volumes.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Action": "ec2:CreateVolume", "Resource": "arn:aws:ec2:*:*:volume/*", "Condition": { "StringEquals": { "ec2:MultiAzConfigurationType": "multi-az-1" } } } ] }
This example denies only ec2:CreateVolume. You can also create a multi-AZ volume by launching an instance with RunInstances and specifying the multi-AZ configuration in the block device mapping, or by restoring one with RestoreVolumeFromRecycleBin. To block those paths as well, deny those actions with the same ec2:MultiAzConfigurationType condition.
Considerations and limitations
Multi-AZ volumes support the following Amazon EBS features:
With Elastic Volumes, you can change a multi-AZ volume's type only between gp3 and io2. You can't convert a multi-AZ volume back to a single-AZ volume.
Multi-AZ volumes do not support the following:
Multi-AZ volumes are not supported on the p6e-gb300 Nitro instance family.
You can't use ModifyInstanceAttribute to change an instance's type while
multi-AZ volumes are attached. To change the instance type, detach the multi-AZ volumes,
change the instance type, and then reattach them.
When you create a multi-AZ volume from a snapshot with an Amazon EBS Provisioned Rate for Volume Initialization, write latency can be higher than normal while initialization is in progress, particularly on gp3 volumes. Write latency returns to its normal level after initialization completes.
Multi-AZ volumes are not available in the following Regions: US West (N. California), Middle East (Bahrain), and Middle East (UAE). Multi-AZ volumes are also not available in the AWS GovCloud (US) Regions or the China Regions.
If you call CreateVolume with a multi-AZ configuration in one of these Regions, the request fails.
Windows boot volumes
The behavior of a Windows boot volume after a failover depends on the EC2Launch version the instance runs, not on the Windows Server version. EC2Launch initializes a Windows instance at boot, including its network configuration. AWS provides both EC2Launch v1 and EC2Launch v2 AMIs for Windows Server 2016 and 2019, so confirm which agent your instance runs.
Instances running EC2Launch v2 are not affected. Windows Server 2022 and 2025 use EC2Launch v2, and AWS also provides EC2Launch v2 AMIs for Windows Server 2016 and 2019.
Instances running EC2Launch v1 are affected. After a failover, the instance starts but can't reach the Instance Metadata Service (IMDS) in the new Availability Zone. Services that rely on IMDS, such as SSM Agent and the CloudWatch agent, do not start. Your volume and its data are not affected.
To determine which agent your instance runs, check for EC2Launch v2. In PowerShell, run the EC2Launch v2 version command, or look for Amazon EC2Launch in Programs and Features. If EC2Launch v2 is not installed, the instance uses EC2Launch v1. For more information about the launch agents and verifying the installed version, see Use the EC2Launch v2 agent and Use the EC2Launch v1 agent in the Amazon EC2 User Guide.
& "C:\Program Files\Amazon\EC2Launch\EC2Launch.exe" version
This behavior happens because EC2Launch v1 restores the instance's saved network routes on every boot, and after a failover those routes still point to the original Availability Zone.
If your instance uses EC2Launch v1, configure it to run its initialization on every boot before you fail over. This configuration rebuilds the network routes for the new Availability Zone after each failover. Setting adminPasswordType to DoNothing keeps per-boot initialization from resetting the local administrator password.
The -SchedulePerBoot option reruns all of EC2Launch v1's enabled initialization tasks on every boot, not only the network routes. For example, it can rename the computer or re-run user data. Before you schedule per-boot initialization, review LaunchConfig.json and disable any tasks that should not repeat.
Run the following PowerShell script in an elevated PowerShell session:
$c='C:\ProgramData\Amazon\EC2-Windows\Launch\Config\LaunchConfig.json' $j=Get-Content $c -Raw | ConvertFrom-Json; $j.adminPasswordType='DoNothing'; $j | ConvertTo-Json -Depth 10 | Set-Content $c & C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -SchedulePerBoot