Amazon Elastic Block Store or EBS is a durable block-based storage device that can be attached to your EC2 instance. AWS released a feature called Multi-Attach, which allows EC2 instances to share a single EBS volume for up to 16 instances and provide higher availability of your applications for Linux workloads. Each instance to which the volume is attached has full read and write permissions to the volume.
The following are several considerations and limitations in using the Multi-Attach feature:
- Multi-Attach enabled volumes do not support I/O fencing. I/O fencing protocols control write access in a shared storage environment to maintain data consistency. Your applications must provide write ordering for the attached instances to maintain data consistency.
- Multi-Attach enabled volumes can be attached to up to 16 instances built on the Nitro System that are in the same Availability Zone.
- Multi-Attach is supported exclusively on Provisioned IOPS SSD (io1) volumes.
- Multi-Attach is available in the us-east-1, us-west-2, eu-west-1, and ap-northeast-2 Regions.
- Multi-Attach enabled volumes can’t be created as boot volumes.
- Multi-Attach enabled volumes can be attached to one block device mapping per instance.
- You can’t enable or disable Multi-Attach after volume creation.
- You can’t change the volume type, size, or Provisioned IOPS of a Multi-Attach enabled volume.
- Multi-Attach can’t be enabled during instance launch using either the Amazon EC2 Console or the RunInstances API.
- Multi-Attach enabled volumes that have an issue at the Amazon EBS infrastructure layer are unavailable to all attached instances. Issues at the Amazon EC2 or networking layer might only impact some attached instances.
- Create EBS Volume
- Head over to EC2 and look for “Volumes”
- Click “Create Volume”
- Volume type should be io1 since it is the only supported volume type for Multi-Attach attach
- Enter your preferred EBS and IOPS
- Availability Zones should be at the same availability zone as the EC2 instance that you will be attaching.
- Tick “Multi-Attach” to “Enable”
2. Attach Volume
- Select the EBS volume that you created.
- Under actions, click “Attach Volume”
- Specify the instance ID of the first EC2 instance
- Device: /dev/sdf
- Do the same process for the second EC2 instance
3. SSH into your two EC2 instances and you should see the newly attached EBS volume. Under the volumes
tab, you can see what instances the EBS volume is attached to.
If your organization utilizes the delete on termination feature of EC2 instances, bear in mind that the EBS Multi-Attach volume will only be deleted when the last EC2 instance where it is attached to is terminated. It is recommended that you use delete on termination on all EC2 instances or to retain EBS volumes whenever their EC2 instances are terminated.
You can monitor your EBS Multi-Attach volume metrics using CloudWatch.