EC2 boot from Multi-Attach Amazon EBS
Assume the following scenario:
- Create an io2 EBS volume from a snapshot of a running EC2.
- Enable multi attach and ask many EC2 to boot from this EBS.
- Every EC2 is the same and I can set up load balancing for them.
In short, I want many EC2 to be the same, using the same EBS.
My question is, can I do that? If can, how? If cannot, any alternative solution(s)?
Citation from AWS Documentation
Multi-Attach enabled volumes can't be created as boot volumes.
Standard file systems, such as XFS and EXT4, are not designed to be accessed simultaneously by multiple servers, such as EC2 instances. Using Multi- Attach with a standard file system can result in data corruption or loss, so this is not safe for production workloads. You can use a clustered file system to ensure data resiliency and reliability for production workloads.
Use AMI instead and EFS for shared storage.
As AlexD has said, this it not possible. If you want many of the same instances for things like dealing with load there's two main options:
- Create a "golden image" which has everything installed and ready to go. This is am AMI / Amazon Machine Image. This can include data, though it's best to reference a data source such as S3 / EFS. You can also run a script to update the OS, download the latest application, etc
- Launch a generic instance and have boot scripts install and configure everything you need at launch time. This is more flexible but tends to be slower and more fragile
Instances are created by autoscaling groups, with access via a load balancer.
AWS is a fairly complex platform. There are plenty of training vendors who can teach you about it. It's important to understand security inside AWS, including (but not limited to) things like EC2 roles, user permissions, guard duty, public / private subnets to protect your instances, backups, etc.