1 00:00:07,278 --> 00:00:08,403 - Now let's run through a demo 2 00:00:08,403 --> 00:00:12,570 of stopping and terminating instances in Amazon EC2. 3 00:00:14,495 --> 00:00:18,328 So again, we're back at the AWS EC2 dashboard. 4 00:00:19,197 --> 00:00:21,205 You can see we have two running instances, 5 00:00:21,205 --> 00:00:24,252 the linux instance and the Windows instance 6 00:00:24,252 --> 00:00:26,257 that we launched earlier. 7 00:00:26,257 --> 00:00:30,192 Now it's important to note that the route volume, 8 00:00:30,192 --> 00:00:33,944 I'm gonna show you here the route device is, 9 00:00:33,944 --> 00:00:37,009 if we click this, you can see that the route device 10 00:00:37,009 --> 00:00:40,411 is an EBS volume, that means that the operating system 11 00:00:40,411 --> 00:00:43,885 is booting from a volume that is hosted by 12 00:00:43,885 --> 00:00:45,763 the elastic block store service, 13 00:00:45,763 --> 00:00:48,592 so that the elastic block store is a device that is 14 00:00:48,592 --> 00:00:51,002 apart from the machine itself. 15 00:00:51,002 --> 00:00:52,585 So because of that, 16 00:00:53,540 --> 00:00:56,764 and we'll talk more about the details of EBS later on, 17 00:00:56,764 --> 00:01:01,521 because of that, that allows us to stop the instance, 18 00:01:01,521 --> 00:01:02,963 rather than just terminate it. 19 00:01:02,963 --> 00:01:04,333 So if we wanna stop the instance 20 00:01:04,333 --> 00:01:08,556 and sort of keep it around, but not actually use the CPU, 21 00:01:08,556 --> 00:01:10,047 and not be billed for it, 22 00:01:10,047 --> 00:01:12,120 then we can potentially stop these machines 23 00:01:12,120 --> 00:01:15,953 and then come back and start them again later. 24 00:01:16,811 --> 00:01:17,994 So in the case of Windows, 25 00:01:17,994 --> 00:01:21,153 I'm just gonna go ahead and show you that from here, 26 00:01:21,153 --> 00:01:23,211 I'm going to highlight just this one, 27 00:01:23,211 --> 00:01:26,512 I'm going to go to actions, instance state, 28 00:01:26,512 --> 00:01:29,572 and you can see I have the ability to stop that machine. 29 00:01:29,572 --> 00:01:32,447 Again stopping and terminating are two different things. 30 00:01:32,447 --> 00:01:35,047 Terminating means that it's gone for good, 31 00:01:35,047 --> 00:01:36,898 stop just means that we will stop 32 00:01:36,898 --> 00:01:39,764 paying the hourly cost of the machine, 33 00:01:39,764 --> 00:01:41,756 and then we can restart it later. 34 00:01:41,756 --> 00:01:44,466 So I'm gonna go ahead and click stop. 35 00:01:44,466 --> 00:01:46,010 And we're gonna talk about this 36 00:01:46,010 --> 00:01:47,851 particular point more later on, 37 00:01:47,851 --> 00:01:50,236 but for now, we should know that if there are 38 00:01:50,236 --> 00:01:52,837 any data on the ephemeral storage of that device, 39 00:01:52,837 --> 00:01:53,966 it's gonna be lost. 40 00:01:53,966 --> 00:01:57,908 And we'll again cover ephemeral storage later on. 41 00:01:57,908 --> 00:02:00,394 So I'm going to stop that machine, 42 00:02:00,394 --> 00:02:02,435 and you can see it's in a stopping state. 43 00:02:02,435 --> 00:02:03,999 We're still paying the hourly cost, 44 00:02:03,999 --> 00:02:06,089 so long as it's in a stopping state, 45 00:02:06,089 --> 00:02:08,251 but as soon as it becomes stopped, 46 00:02:08,251 --> 00:02:11,583 then that's when we stop paying the hourly fee. 47 00:02:11,583 --> 00:02:14,314 While that one is running, 48 00:02:14,314 --> 00:02:16,656 I'm gonna go ahead, 49 00:02:16,656 --> 00:02:19,073 and click our linux instance. 50 00:02:20,219 --> 00:02:23,719 I'm going to go instance state, terminate. 51 00:02:28,710 --> 00:02:30,395 Oh, whoops, I had the other one selected. 52 00:02:30,395 --> 00:02:33,174 Let's make sure that we uncheck that one. 53 00:02:33,174 --> 00:02:36,891 But you can see now our Windows instance is in a stop state. 54 00:02:36,891 --> 00:02:40,224 So it's still there, it still exists in some way, 55 00:02:40,224 --> 00:02:42,499 but it's not actually running. 56 00:02:42,499 --> 00:02:46,176 So from here, I could either restart it or terminate it. 57 00:02:46,176 --> 00:02:49,464 I'm going to select our linux instance, 58 00:02:49,464 --> 00:02:52,659 come down here instance, terminate. 59 00:02:52,659 --> 00:02:54,941 And yes, you can see here the EBS volume 60 00:02:54,941 --> 00:02:57,416 will be deleted when the instance is terminated. 61 00:02:57,416 --> 00:03:00,876 And in this particular case, that's what I want to do. 62 00:03:00,876 --> 00:03:02,396 I'm gonna click terminate. 63 00:03:02,396 --> 00:03:04,656 You can see it goes through a shutting down state, 64 00:03:04,656 --> 00:03:08,044 and then it'll go into a terminated state. 65 00:03:08,044 --> 00:03:10,066 While that one is doing that, 66 00:03:10,066 --> 00:03:13,559 I'm going to go back to our Windows machine, 67 00:03:13,559 --> 00:03:16,852 and say actions, instance state start, 68 00:03:16,852 --> 00:03:19,435 and I can restart that machine. 69 00:03:21,390 --> 00:03:24,146 And now it goes back to a pending state, 70 00:03:24,146 --> 00:03:25,497 and it'll take it a few minutes 71 00:03:25,497 --> 00:03:28,747 before it goes back to a running state. 72 00:03:29,937 --> 00:03:32,105 Sometimes this view might get stuck. 73 00:03:32,105 --> 00:03:34,928 We can always hit the refresh button up here. 74 00:03:34,928 --> 00:03:35,985 And there we go. 75 00:03:35,985 --> 00:03:39,158 Now we can see that our Windows machine is running again, 76 00:03:39,158 --> 00:03:42,111 but our linux machine is now terminated, 77 00:03:42,111 --> 00:03:46,445 and we don't have the option to do anything with it. 78 00:03:46,445 --> 00:03:49,000 It's completely gone at that point. 79 00:03:49,000 --> 00:03:52,000 So that is, stopping and terminating 80 00:03:54,192 --> 00:03:56,192 instances in Amazon EC2.