[Music]
hi I'm Samir a cloud Support Engineer
here at the AWS office in Northern
Virginia sometimes customers tell me
that their data is lost after they stop
and then start an instance and they ask
me why this happened or what they can do
to prevent this data loss I tell them
the reason behind this data loss related
to stopping and starting of an instance
is usually because they are storing
their data on an instant store volume
let's take a look at the scenario and
discuss the best practices suggested by
AWS about using EBS and instance stores
as you can see we are at the Amazon
elastic block store page so I'm a zone
elastic block store Amazon EBS provides
you a persistent block storage volumes
for the use of Amazon ec2 instances in
the AWS cloud each Amazon EBS volume is
automatically replicated within its
availability zone to protect you from
any failure which offers you the high
availability and durability Amazon EBS
volumes offers a consistent and low
latency performance needed to run your
workloads with Amazon EBS you can scale
your usage up or down within minutes at
very low rates so if we move to the
volume creation wizard on the AWS
console we can see that we can specify
the size of an EBS Drive to your needs
also EBS volumes have the different
types such as GP 2 which is general
purpose standard that is magnetic IO one
that is provision I ops st one that is
throughput optimized so you can see all
of them over here while creating a
volume
as you can see I'm at the Amazon ec2
instance store documentation page an
instant store provides a temporary block
level storage for your instance this
storage is located on the discs that are
physically attached to your host
computer you can see it over here an
instant store is ideal for an temporary
storage of information that changes
frequently an instant store consists of
one or more instant store volumes
exposed as block devices the size of an
instant store volume as well as the
number of devices available varies by
the instance types for that
demonstration as you can see I am
already logged in into the AWS
management console we need to select the
Service ec2
and then we need to go over here to the
launch instances to create a new
instance select the ami of your choice
then select the instance type which will
provide you the instant store so you can
see it over here
all of these instance types they provide
only EBS however if you move down you
will see these particular instance types
which will provide you the different
size of the volumes with an instance
store so select any instance type of
your choice go to the configuration
settings and go to the ad storage
in the ad storage if you click over here
add volume you will get the option of
EBS or instant store because we have
selected an instance type which supports
the instance store so we can select the
instance store and launch our instance
the data in an instant store persist
only during the lifetime of its
associated instance if an instance
reboots intentionally or unintentionally
the data of an instance store persist
however the data in an instance store is
lost under the following circumstances
the underlying disk drive fails the
instance stops the instance terminates
so let's take a look at the scenario as
you can see I have already connected to
my instance which has the instance store
volume on it why is Sh
so if you see LS BLK which is list of
lock device you can see there is an
ephemeral storage which is an instance
store so let's get into the instance
store of volume
and touch a file
so if we now do LS we will see that file
is already present over there now let's
stop this instance and see what happens
to our data so I'm going back to the a
SS wizard actions go to instant state
stop the instance you stop
now as you see the instance is stopped
again go to the actions instant state
start the instance hit yes start
okay so instance is now in the running
state let's connect back to our instance
using SSH so I'm back on the terminal
I'm connecting to my instance using SSH
connection so now I have connected to an
instance and let's see so again LS plk
so I have the same ephemeral drive
connected however if we run LS on this
we do not have our file which we were
created earlier so as you can see after
stopping and starting of the instance
our data is lost therefore we do not
rely on an instance store volume for
valuable and long term data instead we
use more durable data storage such as
Amazon s3 Amazon EBS or Amazon EFS
instance store volumes are available in
s DD as well as HDD discs which depends
on the instance type more information
can be found on this link
you can see over here we have instant
stores in HDD as well as in STD forms
you can see we are in the ec2 service
under the ec2 dashboard we have selected
the instances and we have two instances
one I have with an instance store
attached and other I have only EBS
attached so let me walk you through the
process of checking whether we have an
ABS volume attached or an instance store
attached to the instance first we will
check how our system looks without an
instant store volume attached to it as
you can see I have connected to my
instance using SSH connection and if we
run LS BLK which is list of block
devices we can see that I have number of
devices attached number of EBS drive
attached we want to see whether it's an
IBS drive or an instance store drive we
need to query to the metadata server for
that use this command and if you notice
we will see over here it's EBS - EBS 3
EBS 4 so from here we can know well we
have the EBS drive attached to an
instance
now let's use SSH to connect to an
instance where I have attached the
instance store volume when I launch the
instance now run LS blk to see what kind
of block devices we have attached you
can see over here there is an ephemeral
storage attached to your risk there is
another way to check whether we have EBS
volumes or an instance store attached
again query to a metadata server using
this link and you can see over here we
have attached ephemeral 0 a femoral one
so we if you have a test two instance
store drive to our instance to summarize
here are the differences between EBS
volumes and the instance store volumes
data persist on an EBS volume if the
instance is stopped and then restarted
on the other hand data will not persist
on an instance store volume in case of
instance stops terminations or hardware
failures we can attach an EBS volume to
all the instance types that AWS provides
however an instant store volume is
supported by selected instances only the
size of an EBS volume can be decided as
per our needs and can be modified if
required instant store size is
determined by instance type you selected
such as c1 medium see our documentation
for more information about instance
store size we recommend you to store all
important and required data on an EBS
volume temporary data can be stored on
the instance store EBS volumes are very
low cost and can be easily backed up
using a snapshot instant store volumes
are free however you must have a process
to follow to take an EBS backup of the
instance store volume thanks for
watching and happy cloud computing from
all of us here at AWS
[Music]
you
[Music]