Instructor: Okay, so let's have a look
at EBS snapshots in detail.
So we have a volume of two gigabytes,
and I can do Action and then Create Snapshot.
And so we'll go ahead and create a snapshot
directly from my volume, and as you can see,
if my main volume is not encrypted,
then my snapshots will not be encrypted as well.
So let's create the snapshots.
And now if you go to the Snapshots page,
we can see the snapshot being created.
So when you look at a snapshot,
you have multiple things you can look at.
But the first thing we can look
at is the fact that if you do Action,
we can create a volume back from the snapshot.
So we can create another GP2 volume of two gigabits,
and we can extra bytes,
and we can change the availability zone if you wanted to.
So my main volume was in eu-west-1a,
but thanks to the Restore Snapshot option,
I can move my volume to eu-west-1b.
On top of it, we can enable encryption for this volume.
If you wanted to encrypt our EBS volume, the new one
with a KMS key, but I'll leave it unchecked for now.
So let's create this volume.
And now, if we go back to our Volumes page,
we have two volumes, one of them was created from Snapshots.
Now, if you look at the Snapshots page as well,
we can copy the snapshots, and when you copy a snapshot,
you can copy it into the same region,
or a different region for disaster recovery purposes,
and on top of it, when we copy the snapshots
we can encrypt it with a KMS key if we wanted to,
and then any volumes created from the snapshots
would, of course, be encrypted as well.
Okay, so this is a good option.
Next, we can see the other things.
So let's look at something called the Fast Snapshot Restore.
So we can Manage fast snapshot restore,
and this is a setting you enable per snapshots,
and you have to say whether or not
want it to be enabled in the specific AZs.
And when you enable fast snapshot restore,
you're going to pay a lot of money.
Okay, so I don't suggest you click enable because
it gives you a little warning,
it says it costs you per hour, zero point $75.
So the idea is that when you want to restore a huge volume,
then instead of mounting it and then reading all the blocks,
you can enable fast snapshot restore.
AWS will warm up the volume for you,
then you mount the volume, and then you're good to go,
but here we don't need to enable it, of course,
because it makes no sense, we have a two gigabytes volume.
Next, we can look at storage tiers.
So if you look at storage tiers right here,
as you can see, my storage tier is currently standard.
So that means that the storage tier is standard,
but I can actually move the storage tier,
so we can archive the snapshots.
And when you archive the snapshots,
it's going to be in the archived tier,
which is costing you less money, okay?
But if you do so, then it's going to take a little bit
of time to restore from the snapshots.
So you save on costs, but then if you wanna restore
from the snapshots, it will take longer.
So you could go ahead and archive the snapshot
and it will change the actual storage tier.
So let's do it right now, we do Archive Snapshot,
and as you can see, the snapshot is being archived.
And if I go back here, so it took a little bit of time,
but now my snapshot is in the archive storage tier,
and so I'm going just go ahead
and recreate a snapshot real quick,
so I have a snapshot in the normal tier as well.
Okay, so we have two snapshots.
Now, one is standard, one archived.
The other thing I want you to look at,
is the Lifecycle Manager.
So, Lifecycle Manager allows you
to create an EBS snapshot policy,
and we can say what's going to happen,
so we can target either volumes or instances.
And then we need to enter tags.
For example, we need to enter Environment,
and then the value would be prod,
to only do snapshots of our prod volumes.
So if we do so, we have to go back
into the EC2 volumes page and go, for example,
to this volume and say that the tag of this volume,
we're going to manage it, add it and say, well,
for this one, the environment is prod and save it.
And so now, thanks to this type policy,
only the volumes that have been marked
with these tags are going to be archived.
So we have these target resources, okay.
And then we can say demo policy,
and IAM role that will perform these snapshots.
So we'll use the default role,
and it will be created if it doesn't exist.
And then whether or not you want to enable
the policy so enable or not enabled,
so we can enable it, and then we have to add schedules.
So actually just to save on cost,
I'm not going to enable it,
but we can still go ahead with the setup.
So then we can configure schedule.
So how often do you want this policy to happen?
And currently we can create up to four schedules,
so this one and then another three,
but we'll just have one schedule.
And we'll say, okay, daily,
every 12 hours starting at nine A.M., then do a snapshot.
And I want to keep 10 snapshots.
So the idea is that's saying, okay,
we're going to snapshot, snapshot, snapshot, but by the way,
only keep 10 snapshots at a time.
And then you can have some additional advanced settings,
okay, so we can have some tagging on these,
we can actually enable fast snapshot restore
for the snapshots created by the schedule,
but this is really not recommended.
It's going to be very expensive.
We can have cross region copy,
so we can copy the snapshots up to three additional regions.
And this is really good for disaster recovery,
and you have your own settings for these snapshots as well,
as well as cross account sharing,
whether or not you want to share
this snapshot with other accounts.
So it's a very comprehensive way
of managing your backup policy for EBS volumes.
And then it's created, and then if enabled,
go into Snapshot to snapshot your volumes regularly.
So it's quite a powerful feature, and one you should know.
And the last feature I want to show you is the Recycle Bin.
So before, when you took a snapshot and you deleted it,
then it was gone forever, right?
But what you can do is actually put it in the Recycle Bin.
So this prevents against additional accidental deletes.
And so for this, we need to create what's called
a retention rule, and I created a demo retention rule,
but we can create another one,
so demo two retention rule, and we save the resource tag,
so we want to have a Recycle Bin for EBS snapshots,
and we can apply to all the resources of EBS and say okay,
for all my snapshots, or you can use tags to filter.
I want you to be retained for 14 days in the Recycle Bin,
and it's saying anytime it will delete a snapshot,
it will end up in the Recycle Bin,
and this allows us to restore it
in case we did not intend to delete the snapshot.
So we just create this retention rule,
and now we have, as you'll see, two retention rules,
because it's the second one I created, okay?
And then what's going to happen
is that if you do delete the snapshots,
so let me delete this retention right here,
because we don't actually need it,
I already have one, okay,
but if we do delete a snapshot, so let's go ahead and take,
for example, take this one and delete it, it's gone.
We can go into the resources, and as you can see,
well, one of these snapshots, okay,
was put into the Recycle Bin thanks to my Recycle Bin rule.
And so that means that it entered right now,
and it's going to leave in one day,
because this is what my other rule was set up to do.
And what I can do from this is actually recover my snapshots
and so as you can see right here, it doesn't exist, right?
But then I recover it, and all of a sudden,
the snapshot has reappeared
thanks to the Recycle Bin recovering.
Okay, so I think that's all the features you need to know
for EBS snapshots, that's quite a lot,
but it's quite good to know them as a SysOps.
I hope you liked it, and I will see you in the next lecture.