How To Attach Your EBS volume to multiple EC2 instances


Are you exhausted from the complexities and the extra cost associated with the EFS? What if you simply need to share the EBS volume between two EC2 instances?

Say no more - Amazon Web Services has an answer for you!

Starting today, customers running Linux on Amazon Elastic Compute Cloud (EC2) can take advantage of new support for attaching Provisioned IOPS (io1) EBS volumes to multiple EC2 instances, at no extra charge!

Multi-Attach option in EBS

According to AWS, the Multi-Attach capability makes it easier to achieve higher availability for applications that provide write-ordering to maintain storage consistency.

Consider the following scenario: you are running a web application behind the load balancer, and the application expects static assets, such as WordPress media uploads, theme or configuration files, shared between the instances. Instead of using EFS, you could create new PIOPS EBS volume with the Multi-Attach option, mount the volume on each server in read-write mode, and the changes to files would be immediately reflected on each mounted volume.

Restrictions


There are a handful of restrictions that you need to be aware of:
  • Configure your EBS volume with Multi-Attach option,
  • Choose Provisioned IOPS SSD (io1) for Volume Type
  • Multi-Attach requires AWS Nitro System based instance type (T3 for example)
  • The instances and the volume ought to be created in the same AZ
  • Multi-Attach for Provisioned IOPS (io1) volumes on Amazon Elastic Block Store (EBS) is available today at no extra charge to customers in the US East (N. Virginia & Ohio), US West (Oregon), EU (Ireland), and Asia Pacific (Seoul) regions.

Conclusion


The Multi-Attach feature is a double-edged sword. It's a great step towards making it easy to build highly-available web applications in Amazon Web Services, but by all means, it's not perfect.

Multi-attach cannot mount the volume across availability zones, which renders the feature useless for smart DevOps engineers who like to run their production web applications in multiple discrete availability zones. 

Go with the EFS instead.


This article was originally posted by Jeff Barr in AWS News Blog as "New – Multi-Attach for Provisioned IOPS (io1) Amazon EBS Volumes".

Comments

Popular posts from this blog

Stubbing and Mocking Static Methods with PHPUnit

MongoDB: Remove an Arbiter From a Replica Set

Enable HTTP/2 Support in AWS ELB