AWS ::: Developer : Section 6: EC2 Instance Storage

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 Udemy:

 

 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 

Section 6: EC2 Instance Storage

45. EBS Overview

We will look into different storage options for EC2 instances.

  1.  EBS Volumes : The whole purpose is that even if you terminate the instance the data still persists on the EBS Volumes and once you recreate an EC2 instance you can mount the EBS Volumes on it back again and therefore you data is safe and is available back again.
  2. You can think of them as Network USB Stick.

 


 

 


  • One EBS Volume can be attached to only once EC2 instance
  • But you can attach multiple EBS volumes to one EC2 instance
  • Similarly how an EC2 instance is bound to one Availability Zone, similarly you can have EBS volume bound within an Availability Zone. However you can take a snapshot of your EBS volume and take it to the other Availability zone.
  • You can create an EBS volume and keep it unattached to an EC2 instance.
The EBS volume when created

When we go-ahead and create EBS volumes through EC2 instances , there is this thing called 

Delete on Termination Attribute :

When we create an EBS volume over a console.



The delete termination is ticked for root volume and not ticked for EBS volume. This controls the EBS behavior when we delete the EC2 instance 




46. EBS Hands On :

So if you click on the EC2 instance and choose the storage tab.


You can create your own EBS volume.


We are choosing the same Availability Zone which is the same as the EC2 Availability Zone.

New root volume is created. Right click and attach this volume

Now if you go to the EC2 instance and select the storage Tab you will find two EBS volumes attached to it.

Now how to use that EBS volume on EC2 instance is little bit complicated and you need to search the same for in the AWS EBS formating for EC2 .

Key word : format EBS volume to attached to EC2 instance

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html


47. EBS Snapshots Overview



48. EBS Snapshots Hands On


This will happen in the background. To verify the snap shots


You would find the Snap Shot option under the Elastic Block Storage. 


Action -- Copy


The idea is to copy our snapshot to another region and attach it to an EC2 instance in another region or AZ.

The other thing I can do is I can "Create Volume " with it. Here you can choose a volume to be created in another AZ


Now if you go to "Volumes" You would see that the restored volume in a different AZ that you choose from the original one. 



49. AMI Overview

AMI Process from an EC2 Instance :


50. AMI Hands On

Launch an instance , we will deploy the script below in the User Data


Now to start this up and get visible on the browser it took some time for the user data script of installing tool a while , this is also a reason why we create AMI. The bootstrap time can be saved while using an AMI which comes with a preinstalled software. 

Now lets create an AMI out of this EC2 instance .


And now this AMI is been created 

 

Now what I can do is Launch an EC2 instance using this AMI  . Lets click on Lunch Instances

You need to wait for your AMI image to be created it take a while to do so .


Choose My AMI Option , Select this AMI image that we created.


51. EC2 Instance Store

EC2 Instance Store is a hardware disk physically attached to the EC2 instance . This is for extreme disk performance . 

If you terminate or delete an EC2 instance that has an EC2 Instance Store that storage will be lost . And therefore it is called an Ephemeral storage .

This type of storage is not recommended for long time storage.

If you choose to use Instance Store it is entirely your responsibility to back it up and replication will of the data would be completely your responsibility .


What I mean by better performance this is just to illustrate it



52. EBS Volume Types

They come in six different types and they can be categorized by types.


For your EC2 instances only the last point on the slide above can be used, gp2/gp3 and io1/io2  for boot volumes.

For gp3 you can independently define, whereas for gp2 it is linked.



53. EBS Multi-Attach

I told you that EBS volume can be attached to only one EC2 instance . This feature enable you attach EBS volumes to multiple EC2 instances in the same AZ.



54. EFS Overview   NEED TO REVIEW THIS ONCE AGAIN

This is a managed File system that can be mounted on many EC2 instance across many different AZs

 




55. EFS Hands On

Creating a EFS - Network File System .



EFS is a network file system and you can have it across multiple AZs

each AZ / subnet we need to , we will create security groups from the left hand side. 


We will give the new security group .


 


56. EFS vs EBS



57. EBS & EFS - Section Cleanup

Deleting the filen system


Remove EC2 instance 

Remove volumes

Remove snapshots

Remove Security Groups except the default one















Comments

Popular posts from this blog

AWS Data Replication

AWS SysOps