Can we attach an EBS volume to more than one EC2 instance at the same time?
A. No
B. Yes.
C. Only EC2-optimized EBS volumes.
D. Only in read mode.
2 Comments on “Can we attach an EBS volume to more than one EC2 instan…”
Mohammed Faisal Siddiquesays:
You can attach an EBS volume to one of your instances that is in the same Availability Zone as the volume. If it is not in the same availability zone you cannot. The questions does not talk about the locations of EC2 instances.
1
4
leosays:
Even if you were able to get an EBS volume attached to more than one instance, it would be a _REALLY_BAD_IDEA_. To quote Kekoa, “this is like using a hard drive in two computers at once”
Why is this a bad idea? … The reason you can’t attach a volume to more than one instance is that EBS provides a “block storage” abstraction upon which customers run a filesystem like ext2/ext3/etc. Most of these filesystems (eg, ext2/3, FAT, NTFS, etc) are written assuming they have exclusive access to the block device. Two instances accessing the same filesystem would almost certainly end in tears and data corruption.
You can attach an EBS volume to one of your instances that is in the same Availability Zone as the volume. If it is not in the same availability zone you cannot. The questions does not talk about the locations of EC2 instances.
1
4
Even if you were able to get an EBS volume attached to more than one instance, it would be a _REALLY_BAD_IDEA_. To quote Kekoa, “this is like using a hard drive in two computers at once”
Why is this a bad idea? … The reason you can’t attach a volume to more than one instance is that EBS provides a “block storage” abstraction upon which customers run a filesystem like ext2/ext3/etc. Most of these filesystems (eg, ext2/3, FAT, NTFS, etc) are written assuming they have exclusive access to the block device. Two instances accessing the same filesystem would almost certainly end in tears and data corruption.
1
3