Instructor: Welcome to this section
where we will at look the different storage options
for EC2 instances.
So first, the most important ones
are going to be EBS Volumes, so let's define what they are.
An EBS Volume stands for Elastic Block Store.
It's a network drive that you can attach to your instances
while they run,
and we've been using them without even knowing.
So this EBS Volumes allow us to persist data,
even after the instance is terminated.
And so that's the whole purpose,
we can recreate an instance
and mount to the same EBS Volume from before
and we'll get back our data.
That is very helpful.
So these EBS Volumes, at the CCP level,
can only be mounted to one instance at a time, okay?
And when you create an EBS Volume,
it is bound to a specific availability zone.
That means that you cannot have an EBS Volume
in created, for example, us-east-1a
we'll see this in the diagram in a second.
So how do you think of EBS Volumes?
Well, you can think of them as network USB sticks.
So, it's a USB stick that you can take from a computer
and put it in another computer
but you actually don't physically put it in a computer.
It's attached through the network.
The feature gives us 30 GBs of free EBS storage
of type General Purpose or SSD or Magnetic per month.
And in this course, we'll be using this
with the GP2 to GP3 Volumes.
Now let's look at it.
So EBS Volumes are network drivers
that is not a physical drive, okay?
So to communicate between the instance and the EBS Volume,
it will be using the network.
And because the network is used,
there may be a bit of latency from one computer
to reach to another server.
Now, EBS Volumes, because they are a network drive
they can be detached from an EC2 instance
and attached to another one very quickly.
And that's makes it super handy
when you want to do failovers for example.
EBS Volumes are locked to a specific availability zones,
that means that, as I said, if it's created in us-east-1a
it cannot be attached to us-east-1b
but, we will see in this section that if we do a snapshot,
then we are able to move a volume across
from different availability zones.
And finally, it's a volume,
so you have to provision capacity in advance.
So you need to say how many GBs you want in advance
and the IOPS, which is I/O operations per seconds,
and you're basically defining how you want
your EBS Volume to perform.
You're going to get billed for that provision capacity
and you can increase the capacity over time
if you want you to have better performance or more size.
So, as a diagram, how does it look like?
Well, we have us-east-1a with one EC2 instance
and we can attach, for example
one EBS Volume to the EC2 instance.
If we create another EC2 instance,
as I said an EBS Volume can not be attached to two instances
at a time at the Certified Cloud Practitioner level.
And therefore, what I wanna say is that
this other EC2 instance needs to have
its own EBS Volume attached to it,
but it is a very possible for us to have two EBS Volumes
attached to one instance
think of it as two network USB sticks into one machine
that makes a lot of sense.
Now EBS Volumes are linked to an availability zone.
So as we can see, all this diagram has been so far using
us-east-1a.
So if you want it to have other EBS Volumes in an other AZ
then you would need to create this separately
in the other availability zone.
So just same way that's your EC2 instances
are bound to an AZ, so are the EBS Volumes.
Finally, it is possible for us to create EBS Volumes
and leave them unattached
they don't need to be necessarily attached
to an ECG instance, they can be attached on demand
and that makes it very, very powerful.
Finally, when we go ahead and create EBS Volumes
through EC2 instances, there is this thing
called a Deletes on Termination attribute
and this can come up in the exam so,
if you look at this when we create
an EBS Volume in the console, when we create an EC2 instance
there is the second to last column
called Delete on Termination.
And by default, it is ticked for the Root Volume
and not ticked for a new EBS Volume.
So this controls the EBS behavior
when an EC2 instance is being terminated.
So by default, as we can see, the root EBS Volume
is deleted alongside the instance being terminated.
So it's enabled
and the default any other attached EBS Volume is not deleted
because it's disabled by default.
But obviously as we can see in this UI, we can control
if you want to enable or disable delete on termination.
And so use case right, would be for example,
if you want to preserve the root volume,
when an instance is terminated,
for example, to save some data
then you can disable delete on termination
for the root volume, and you'll be good to go
and it could be an exam scenario at the exam.
So I hope you liked it.
And I will see you in the next lecture.