- Now let's run through a demo
of stopping and terminating instances in Amazon EC2.
So again, we're back at the AWS EC2 dashboard.
You can see we have two running instances,
the linux instance and the Windows instance
that we launched earlier.
Now it's important to note that the route volume,
I'm gonna show you here the route device is,
if we click this, you can see that the route device
is an EBS volume, that means that the operating system
is booting from a volume that is hosted by
the elastic block store service,
so that the elastic block store is a device that is
apart from the machine itself.
So because of that,
and we'll talk more about the details of EBS later on,
because of that, that allows us to stop the instance,
rather than just terminate it.
So if we wanna stop the instance
and sort of keep it around, but not actually use the CPU,
and not be billed for it,
then we can potentially stop these machines
and then come back and start them again later.
So in the case of Windows,
I'm just gonna go ahead and show you that from here,
I'm going to highlight just this one,
I'm going to go to actions, instance state,
and you can see I have the ability to stop that machine.
Again stopping and terminating are two different things.
Terminating means that it's gone for good,
stop just means that we will stop
paying the hourly cost of the machine,
and then we can restart it later.
So I'm gonna go ahead and click stop.
And we're gonna talk about this
particular point more later on,
but for now, we should know that if there are
any data on the ephemeral storage of that device,
it's gonna be lost.
And we'll again cover ephemeral storage later on.
So I'm going to stop that machine,
and you can see it's in a stopping state.
We're still paying the hourly cost,
so long as it's in a stopping state,
but as soon as it becomes stopped,
then that's when we stop paying the hourly fee.
While that one is running,
I'm gonna go ahead,
and click our linux instance.
I'm going to go instance state, terminate.
Oh, whoops, I had the other one selected.
Let's make sure that we uncheck that one.
But you can see now our Windows instance is in a stop state.
So it's still there, it still exists in some way,
but it's not actually running.
So from here, I could either restart it or terminate it.
I'm going to select our linux instance,
come down here instance, terminate.
And yes, you can see here the EBS volume
will be deleted when the instance is terminated.
And in this particular case, that's what I want to do.
I'm gonna click terminate.
You can see it goes through a shutting down state,
and then it'll go into a terminated state.
While that one is doing that,
I'm going to go back to our Windows machine,
and say actions, instance state start,
and I can restart that machine.
And now it goes back to a pending state,
and it'll take it a few minutes
before it goes back to a running state.
Sometimes this view might get stuck.
We can always hit the refresh button up here.
And there we go.
Now we can see that our Windows machine is running again,
but our linux machine is now terminated,
and we don't have the option to do anything with it.
It's completely gone at that point.
So that is, stopping and terminating
instances in Amazon EC2.