AWS : Storage as a Service (part 1)
Create EBS volume and attaching to Ec2 instance and Transferring a EBS volume from a region to another region .

What is Storage?
Storage is Device which used to store data persistently.
Types of Storage :
- Block Storage
- Object Storage
- File Storage
- Block Storage :
Data → Breaks into Blocks then It will Stored → each block has unique identifier.
In AWS , EBS (Elastic Block Store) is service which is used as block storage.
In Ec2 , there are two type of Block Storage :

lets Start with EBS service :
- Elastic block Storage
- It is persistence Storage.
- It is found under Ec2 service .
Lets Start with Practical Part of EBS volume creation :
- we can create a EBS volume separately then we can attach it with EC2.
Step 1. GO to Ec2 dashboard → Elastic block Store → click on volume

Step 2. Click on Create Volume :

Step 3. Fill up the content according to your use case then click on create volume :


after creating EBS volume you can edit the name of volume :

Step 4. Attach EBS volume to a Ec2 Instance : -
For creating a Ec2 Instance , you can refer to this blog .
Select that volume → click on action → then click on Attach volume

Fill up Details then click on attach

It is attached to VM1 or not , You can check via Ec2 instance storage details :

You can see in above image there is a volume of 1GiB attached to MyVM1(Ec2-instance).
2. At Time of Launching Ec2 instance at that time we can add a EBS volume in Configure Storage Section.

Q. Can we attach a volume(MYVolume1)(It already attached to a Ec2 instance named MyVM1) to another Ec2 Instance (MyVM2) ?
Answer is No, we can’t attach a volume to another Ec2 instance if it already attached to any Ec2 instance.
But there are other ways to do it :
- We can first detach EBS (MYVolume1) from first Ec2 instance(MyVM1) then we can attach it into Other Ec2 instance(MyVM2).
- We can create a Snapshot of EBS volume(MYVolume1) then Attach like :
MyVM1 → EBS (MYVolume1)
MYVM2 → Snapshot(s1)
3. Attach EBS (MYVolume1) to Ec2 instance (MYVM1) then create an AMI then launch a Ec2 instance from that AMI.
Lets do this
Step 1. create an AMI from EC2 Instance (MYVM1) we previously created and attached a EBS Volume(MYVolume1) to it :

Fill up some details like Image name and description of image then click on create Image :


Step 2. Launch a Ec2 instance from this AMI :

Go to My AMI → Choose your AMI then Add key pair and launch an instance :


Step 3. You can check is EBS volume attached to new Instance or not by going to Ec2 dashboard and go to Storage tab :

UseCase :
How to use A EBS volume to other region ?
→ By creating an AMI then copy that AMI to different Region and launch an Instance from that AMI.

Step 1. Create a AMI(from Ec2 + EBS volume attached) :
I already created a AMI(from Ec2 + EBS volume attached) in Mumbai region.
Step 2. Copy this AMI to N. virginia region
go to EC2 dashboard → Image → AMI → select AMI → Action → copy AMI


Step 3.go to N. Virginia region and Launch Ec2 instance from that AMI, then use that EBS volume .
you can see here , it is copied to N. Virginia region.

Now I’m going to launch Ec2 instance from this AMI.

Choosing My AMIs → AMI copied from Mumbai region.

If you don’t have key pair in that region create key pair and attach it :


You can see that volume came to N. Virginia region . now you can use it.

Thanks for reading this blog ….
Continue….