WEBVTT 0:00:02.760000 --> 0:00:08.080000 Hi, welcome to this video on managing virtual machines and managing Azure 0:00:08.080000 --> 0:00:09.080000 virtual machines. 0:00:09.080000 --> 0:00:12.840000 In this video, we're going to take a look at monitoring virtual machines, 0:00:12.840000 --> 0:00:15.180000 what are the options for monitoring a virtual machine. 0:00:15.180000 --> 0:00:18.740000 We'll talk about moving virtual machines, what you need to do if you need 0:00:18.740000 --> 0:00:23.340000 to move a virtual machine, and we'll talk about images and snapshots, 0:00:23.340000 --> 0:00:27.280000 taking images and snapshots of virtual machines, or building an image 0:00:27.280000 --> 0:00:30.020000 based on a virtual machine or taking a snapshot. 0:00:30.020000 --> 0:00:33.860000 Then I'm going to go ahead and demonstrate some ways that you can monitor 0:00:33.860000 --> 0:00:36.800000 virtual machines, just kind of give you the touch points on that. 0:00:36.800000 --> 0:00:39.800000 Then we're going to take a look at how you could go about creating a virtual 0:00:39.800000 --> 0:00:42.080000 machine from a snapshot. 0:00:42.080000 --> 0:00:45.400000 We'll talk about why you would do that in the content and then I'll demonstrate 0:00:45.400000 --> 0:00:47.680000 it. So let's go ahead, let's take a look. 0:00:47.680000 --> 0:00:53.280000 We're going to start out looking at monitoring virtual machines. 0:00:53.280000 --> 0:00:58.140000 I put it as kind of four different levels of virtual machine monitoring 0:00:58.140000 --> 0:00:59.080000 that you've got. 0:00:59.080000 --> 0:01:04.020000 This is true to a greater or lesser extent with both Windows and Linux. 0:01:04.020000 --> 0:01:09.260000 I will tell you that while Linux and Windows are equal within the Azure 0:01:09.260000 --> 0:01:13.600000 environment, in some cases sometimes Windows is a little more equal than 0:01:13.600000 --> 0:01:19.140000 Linux. In the case of diagnostics, that is the case, or can be seen as 0:01:19.140000 --> 0:01:21.660000 the case. We'll get to that in just a moment. 0:01:21.660000 --> 0:01:24.640000 But there are still four levels regardless and so we'll take a look at 0:01:24.640000 --> 0:01:28.680000 this. The first is basic and this is really the monitoring that you're 0:01:28.680000 --> 0:01:32.520000 going to get if you just provision a virtual machine. 0:01:32.520000 --> 0:01:37.660000 You're going to get some host diagnostics or host performance. 0:01:37.660000 --> 0:01:41.860000 So well basic things like network and average CPU which is calculated 0:01:41.860000 --> 0:01:43.320000 at the host level. 0:01:43.320000 --> 0:01:46.080000 So you can get that in graph that and make something of it. 0:01:46.080000 --> 0:01:48.580000 Plus you're going to get the activity log. 0:01:48.580000 --> 0:01:51.740000 So you can see the things at the control plane. 0:01:51.740000 --> 0:01:57.680000 So at the Azure level, what's going on with your virtual machine? 0:01:57.680000 --> 0:02:03.360000 Now all of the next three require some kind of configuration for your 0:02:03.360000 --> 0:02:04.440000 virtual machine. 0:02:04.440000 --> 0:02:06.860000 The first and simplest is boot diagnostics. 0:02:06.860000 --> 0:02:10.360000 This is simply an option when you deploy a virtual machine. 0:02:10.360000 --> 0:02:13.760000 If you're going through the portal boot diagnostics, it's actually a default 0:02:13.760000 --> 0:02:15.680000 option having it on. 0:02:15.680000 --> 0:02:18.760000 If you're deploying from a template, it actually in most of the tools 0:02:18.760000 --> 0:02:21.700000 I use is also defaulted on, but you can change that. 0:02:21.700000 --> 0:02:26.040000 But one thing that differentiates it, for example, from basic is that 0:02:26.040000 --> 0:02:30.520000 if you're going to use boot diagnostics, you have to have a storage account 0:02:30.520000 --> 0:02:33.320000 because that boot diagnostic data is going to go into the storage account 0:02:33.320000 --> 0:02:36.380000 and it is exactly what it sounds like. 0:02:36.380000 --> 0:02:40.220000 When your system boots up, the log that's generated, the standard output 0:02:40.220000 --> 0:02:44.460000 that's generated, is going to be captured and you can go and view that 0:02:44.460000 --> 0:02:50.280000 data. In the case of the Windows virtual machines, you'll get a snapshot, 0:02:50.280000 --> 0:02:54.040000 a screenshot of when it comes up, which normally is not going to be all 0:02:54.040000 --> 0:02:57.940000 that useful, but if you got maybe a blue screen of death on this startup, 0:02:57.940000 --> 0:03:03.360000 you could see that and you're also going to get a visual log of what has 0:03:03.360000 --> 0:03:08.380000 transpired. Now in Linux, you're going to get the visual log. 0:03:08.380000 --> 0:03:11.240000 I will tell you personally, I find it the one for Linux is actually a 0:03:11.240000 --> 0:03:15.200000 little bit easier to read, but in any case, that's what you're going to 0:03:15.200000 --> 0:03:20.540000 get. Now, if I want to take the next step, I can install a diagnostics 0:03:20.540000 --> 0:03:27.840000 extension and what that's going to do is give me enhanced logging of my 0:03:27.840000 --> 0:03:32.060000 performance and my diagnostic data, simple as that. 0:03:32.060000 --> 0:03:35.940000 It is an extension that gets installed, standardized extension and installs 0:03:35.940000 --> 0:03:37.940000 in both Linux and Windows. 0:03:37.940000 --> 0:03:41.040000 Now, the options for each are going to be a little bit different because 0:03:41.040000 --> 0:03:45.440000 of course, the diagnostic data you capture for Linux, the sys log data, 0:03:45.440000 --> 0:03:48.140000 for example, is going to be different than the diagnostic data that you 0:03:48.140000 --> 0:03:52.460000 capture for a Windows machine, but you have control over that. 0:03:52.460000 --> 0:03:56.340000 Not only does it let you really capture quite a bit of information, but 0:03:56.340000 --> 0:03:59.580000 it lets you actually control which of that information is being captured. 0:03:59.580000 --> 0:04:04.440000 And then really what I would consider the kind of highest level of diagnostics 0:04:04.440000 --> 0:04:09.400000 is adding in the log analytics extension that is going to tie your virtual 0:04:09.400000 --> 0:04:12.140000 machine into a log analytics workspace. 0:04:12.140000 --> 0:04:14.420000 So it's going to report its information there. 0:04:14.420000 --> 0:04:19.220000 It also makes it available for network performance monitoring within your 0:04:19.220000 --> 0:04:23.320000 log analytics. So, you know, again, keep in mind the basic. 0:04:23.320000 --> 0:04:26.900000 You've just got right away the boot diagnostic really is only going to 0:04:26.900000 --> 0:04:29.300000 impact during the boot process. 0:04:29.300000 --> 0:04:32.800000 So it's very low impact and it's going to capture that data. 0:04:32.800000 --> 0:04:36.320000 The diagnostic extension and the log analytics extension, both of those 0:04:36.320000 --> 0:04:39.920000 are going to be running as background processes within your virtual machine. 0:04:39.920000 --> 0:04:44.180000 So low touch. I don't have specific numbers, but I will just say they've 0:04:44.180000 --> 0:04:47.060000 never really gotten in the way of anything that I'm doing performance 0:04:47.060000 --> 0:04:50.560000 wise, but they are running on your machines. 0:04:50.560000 --> 0:04:56.620000 So those are the monitoring options that we have for our virtual machines. 0:04:56.620000 --> 0:05:00.520000 Now, the next thing I want to talk about is moving virtual machines. 0:05:00.520000 --> 0:05:02.040000 I've got a virtual machine one place. 0:05:02.040000 --> 0:05:03.420000 I need it somewhere else. 0:05:03.420000 --> 0:05:07.640000 Now, what you have to do to move a virtual machine really kind of depends 0:05:07.640000 --> 0:05:09.720000 on how you're moving it. 0:05:09.720000 --> 0:05:13.920000 And really the deciding factor is whether you're moving it outside of 0:05:13.920000 --> 0:05:15.060000 a region. Right. 0:05:15.060000 --> 0:05:19.380000 So if I'm moving a virtual machine and I'm moving it within the same region 0:05:19.380000 --> 0:05:23.180000 and within the same subscription, I can just move it between resource 0:05:23.180000 --> 0:05:27.240000 groups. And that's an online operation. 0:05:27.240000 --> 0:05:31.820000 I can also within and by online operation, what that means is that the 0:05:31.820000 --> 0:05:34.440000 virtual machine itself is not going to be reset. 0:05:34.440000 --> 0:05:35.340000 It's not going to be rebooted. 0:05:35.340000 --> 0:05:37.880000 You're not going to have downtime for the virtual machine. 0:05:37.880000 --> 0:05:43.100000 I can also actually move a virtual machine between subscriptions. 0:05:43.100000 --> 0:05:46.900000 So if I've got a virtual machine that we started up, let's say in a development 0:05:46.900000 --> 0:05:50.960000 subscription, and that is just such an amazing virtual machine, we just 0:05:50.960000 --> 0:05:55.260000 want to take it as is and put it right into our production subscription, 0:05:55.260000 --> 0:05:56.940000 you can actually do that. 0:05:56.940000 --> 0:06:01.940000 However, you have to make sure that all dependent objects are moved together. 0:06:01.940000 --> 0:06:06.560000 So at a minimum, I've got my virtual machine, I've got the NIC for the 0:06:06.560000 --> 0:06:09.360000 virtual machine, and I've got the virtual network that it's on. 0:06:09.360000 --> 0:06:11.460000 All of those would have to move together. 0:06:11.460000 --> 0:06:14.100000 And then of course, if there's any other dependencies, they would have 0:06:14.100000 --> 0:06:17.880000 to move as well, public IP address, a load balancer, other virtual machines 0:06:17.880000 --> 0:06:19.700000 that are on the same virtual network. 0:06:19.700000 --> 0:06:22.780000 So that one's not necessarily a no brainer. 0:06:22.780000 --> 0:06:25.680000 And it's probably not something that would be super common. 0:06:25.680000 --> 0:06:29.280000 I could see moving between resource groups, different groups take over 0:06:29.280000 --> 0:06:30.980000 management of your resources. 0:06:30.980000 --> 0:06:34.620000 So you want to put them under different authority, you can do that easily 0:06:34.620000 --> 0:06:36.380000 using resource groups. 0:06:36.380000 --> 0:06:41.160000 Now, even though the virtual machine itself is live the entire time, the 0:06:41.160000 --> 0:06:44.920000 resource groups, both the source and destination are locked themselves 0:06:44.920000 --> 0:06:46.860000 during this process. 0:06:46.860000 --> 0:06:51.180000 So if I'm moving a VM from resource group A to resource group B, during 0:06:51.180000 --> 0:06:55.560000 that time, I cannot add, delete or modify the settings of any resources 0:06:55.560000 --> 0:06:59.020000 in either of those resource groups, not a big deal. 0:06:59.020000 --> 0:07:04.380000 If you do need to move a virtual machine between regions, there is no 0:07:04.380000 --> 0:07:06.240000 built in way to do that. 0:07:06.240000 --> 0:07:10.020000 It's not difficult to do, but it will be a manual process. 0:07:10.020000 --> 0:07:13.860000 And it does involve actually deprovisioning the virtual machine. 0:07:13.860000 --> 0:07:16.280000 So you are talking about downtime. 0:07:16.280000 --> 0:07:19.540000 What you would do is you would take the virtual machine, you would shut 0:07:19.540000 --> 0:07:23.000000 it down, you would deprovision it, delete the virtual machine definition, 0:07:23.000000 --> 0:07:24.820000 your disks are still there. 0:07:24.820000 --> 0:07:28.240000 You would then move the disk or copy the disk from whatever region they're 0:07:28.240000 --> 0:07:31.920000 in into whatever region you want them to be in, and simply create a virtual 0:07:31.920000 --> 0:07:34.000000 machine using those disks. 0:07:34.000000 --> 0:07:37.820000 It's a pretty straightforward operation, but it does involve potentially 0:07:37.820000 --> 0:07:42.640000 significant downtime, as well, of course, as probably getting things like 0:07:42.640000 --> 0:07:47.500000 a different public IP address that you would then need to update in terms 0:07:47.500000 --> 0:07:50.980000 of any links that you have to that virtual machine. 0:07:50.980000 --> 0:07:54.660000 So that is moving a virtual machine. 0:07:54.660000 --> 0:08:01.420000 Now, what I want to talk about are ways that you can effectively duplicate 0:08:01.420000 --> 0:08:03.100000 your virtual machine. 0:08:03.100000 --> 0:08:07.260000 Let's look at this from the standpoint of an example. 0:08:07.260000 --> 0:08:13.080000 Let's say that I've got a virtual machine, and my virtual machine is running 0:08:13.080000 --> 0:08:20.240000 as a web app. And that virtual machine has, we'll just keep it simple, 0:08:20.240000 --> 0:08:24.680000 one OS disk and all of the configuration is on this OS disk. 0:08:24.680000 --> 0:08:31.300000 Now, let's say that something has gone wrong, and I want to be able to 0:08:31.300000 --> 0:08:41.580000 test this out. Well, I could potentially, I could take a backup, and then 0:08:41.580000 --> 0:08:51.860000 I could restore that backup somewhere, and I could create my web app on 0:08:51.860000 --> 0:08:55.360000 top of that. You could do that, or I could shut it down, and I could duplicate 0:08:55.360000 --> 0:08:58.620000 it, the disk itself, and start it. 0:08:58.620000 --> 0:08:59.940000 There's a lot of ways that you could do that. 0:08:59.940000 --> 0:09:06.000000 Or what I could do to simplify it, let me back all of this out. 0:09:06.000000 --> 0:09:22.760000 That's as far as I go, I could simply take a live snapshot, and then from 0:09:22.760000 --> 0:09:30.100000 that snapshot, create a disk, and then simply provision a virtual machine 0:09:30.100000 --> 0:09:34.040000 on top of that. Now, even though it's the same number of steps, the process 0:09:34.040000 --> 0:09:37.640000 is much more straightforward, and more importantly, it's faster with a 0:09:37.640000 --> 0:09:40.380000 snapshot. There's nothing offline. 0:09:40.380000 --> 0:09:41.360000 It does it live. 0:09:41.360000 --> 0:09:46.480000 It's done through the Azure environment, and I get a working snapshot 0:09:46.480000 --> 0:09:49.300000 of my disk. Very simple. 0:09:49.300000 --> 0:09:53.280000 Snapchat is important, is done at the disk level. 0:09:53.280000 --> 0:09:57.340000 You can take snapshots of individual disks. 0:09:57.340000 --> 0:10:03.340000 Now, alternatively, we're going to wipe that out. 0:10:03.340000 --> 0:10:06.980000 Alternatively, I have the ability to create images. 0:10:06.980000 --> 0:10:09.340000 Let's take the same example. 0:10:09.340000 --> 0:10:16.360000 Let's say that I've got a web app, and this web app is amazing. 0:10:16.360000 --> 0:10:17.240000 I've got it configured. 0:10:17.240000 --> 0:10:20.020000 I went through and I manually configured this disk. 0:10:20.020000 --> 0:10:27.160000 But now, we want to have this either be able to easily create multiple 0:10:27.160000 --> 0:10:33.140000 instances of it, or maybe even better take that configuration and use 0:10:33.140000 --> 0:10:36.660000 it in a virtual machine scale set. 0:10:36.660000 --> 0:10:44.500000 But that is a disk, not an image. 0:10:44.500000 --> 0:10:53.540000 What I want to do is I'm going to take the actual virtual machine, and 0:10:53.540000 --> 0:11:00.680000 I want to create an image based on the virtual machine. 0:11:00.680000 --> 0:11:06.340000 And then take that image and use it, for example, as a source of a virtual 0:11:06.340000 --> 0:11:08.000000 machine scale set or anything else. 0:11:08.000000 --> 0:11:13.600000 Now, that image is going to, of course, include not only the OS disk, 0:11:13.600000 --> 0:11:23.000000 but if I few things that you have to do in order to generate an image, 0:11:23.000000 --> 0:11:26.240000 the first thing that you have to do is you actually have to generalize 0:11:26.240000 --> 0:11:31.080000 the OS. And the way you generalize the OS depends on whether you are running 0:11:31.080000 --> 0:11:34.800000 a Windows virtual machine or a Linux virtual machine. 0:11:34.800000 --> 0:11:38.860000 If I'm running a Windows virtual machine, I need to attach to the virtual 0:11:38.860000 --> 0:11:45.000000 machine, either through RDP remote desktop or through wind remote management 0:11:45.000000 --> 0:11:48.620000 when RM. And I need to run a SIS prep. 0:11:48.620000 --> 0:11:52.040000 And in fact, I need to run SIS prep with generalized and the out of box 0:11:52.040000 --> 0:11:54.560000 experience or just switches for SIS prep. 0:11:54.560000 --> 0:11:57.500000 If you're familiar with SIS prep, then you're probably familiar with those 0:11:57.500000 --> 0:12:01.380000 switches. If you're not, it's a pretty easy read, you can you can find 0:12:01.380000 --> 0:12:02.560000 out what they are. 0:12:02.560000 --> 0:12:07.640000 If it is a Linux machine, then I need to generalize that machine as well. 0:12:07.640000 --> 0:12:10.940000 What generalization does is it wipes out things like the username and 0:12:10.940000 --> 0:12:14.500000 password, the networking settings, so that as you create new instances, 0:12:14.500000 --> 0:12:17.080000 they're not trying to pick up those old settings. 0:12:17.080000 --> 0:12:21.120000 In order to generalize a Linux machine, you're going to have to look at 0:12:21.120000 --> 0:12:24.800000 the particular distro, Ubuntu, etc. 0:12:24.800000 --> 0:12:30.740000 In general, what you're going to do is run a command that uses the Azure 0:12:30.740000 --> 0:12:35.380000 agent. It's a WA agent, which is Windows Azure agent. 0:12:35.380000 --> 0:12:41.040000 And it has a process for generalizing the OS. 0:12:41.040000 --> 0:12:43.900000 And so you generalize the OS, that's the first step. 0:12:43.900000 --> 0:12:51.500000 And so we could say, if I'm going to take an image, one, I generalize 0:12:51.500000 --> 0:13:03.260000 the OS. Now, the next thing that I need to do is actually generalize the 0:13:03.260000 --> 0:13:07.500000 VM. Now, once you generalize a VM, and you have to do this, if you're 0:13:07.500000 --> 0:13:12.480000 going to use it as an image, once you generalize a VM, that VM is no longer 0:13:12.480000 --> 0:13:16.540000 usable, you're marking all the disks as generalized, all of the managed 0:13:16.540000 --> 0:13:18.960000 or unmanaged disks as generalized. 0:13:18.960000 --> 0:13:22.180000 And I cannot, once it's been marked as generalized, just run a VM directly 0:13:22.180000 --> 0:13:27.020000 on it. The next thing that you need to do in order to have an image is 0:13:27.020000 --> 0:13:33.600000 you need to actually create the image. 0:13:33.600000 --> 0:13:37.860000 And that is going to essentially just be metadata that wraps up those 0:13:37.860000 --> 0:13:42.500000 generalized marked disks and says, okay, if you're going to create a new 0:13:42.500000 --> 0:13:46.420000 instance, here's the disk or disks that you want to use for that instance. 0:13:46.420000 --> 0:13:50.940000 Now, the good news is that it's a fairly straightforward process in that. 0:13:50.940000 --> 0:13:54.880000 If you want from the portal, you can use a portal to actually do both 0:13:54.880000 --> 0:13:59.420000 of those at the same time, but you do need to generalize the OS first 0:13:59.420000 --> 0:14:02.360000 before you use a portal to do that. 0:14:02.360000 --> 0:14:07.520000 So snapshots and images are two different ways of getting copies of a 0:14:07.520000 --> 0:14:08.520000 virtual machine. 0:14:08.520000 --> 0:14:11.900000 If you take a snapshot, you can create a single virtual machine that is 0:14:11.900000 --> 0:14:17.100000 going to be configured exactly as the original, you can give it a different 0:14:17.100000 --> 0:14:23.960000 name. If you create an image, you have to generalize both the OS and the 0:14:23.960000 --> 0:14:27.360000 virtual machine and really the disks underneath the virtual machine. 0:14:27.360000 --> 0:14:31.920000 And then you can create multiple copies of that with different configurations. 0:14:31.920000 --> 0:14:37.380000 All right. And so that is the idea of taking both snapshots and images. 0:14:37.380000 --> 0:14:41.600000 Now, what I'm going to do is I'm going to go through actually two demonstrations. 0:14:41.600000 --> 0:14:44.160000 The first demonstration is going to be monitoring virtual machines. 0:14:44.160000 --> 0:14:52.460000 I'm just, as I said, really going to all four levels of monitoring setup. 0:14:52.460000 --> 0:14:56.040000 And then I'm going to take a look at creating a virtual machine from a 0:14:56.040000 --> 0:15:00.080000 snapshot, which I have already done, some of which we're going to kind 0:15:00.080000 --> 0:15:03.780000 of do this as a cooking show demo and just kind of see how we could go 0:15:03.780000 --> 0:15:06.940000 about doing that for, let's say, testing purposes. 0:15:06.940000 --> 0:15:11.400000 All right. Now let's go ahead and jump into that. 0:15:11.400000 --> 0:15:21.820000 The first thing I'm going to do see here, VM image demo. 0:15:21.820000 --> 0:15:30.540000 This is a resource group where I've got my, I've got a virtual machine, 0:15:30.540000 --> 0:15:34.560000 I've got all of the trappings of the virtual machine. 0:15:34.560000 --> 0:15:36.180000 Now I've already taken a snapshot. 0:15:36.180000 --> 0:15:38.260000 Now, show you how to do that. 0:15:38.260000 --> 0:15:41.440000 But other than that snapshot, everything else is pretty much the minimum 0:15:41.440000 --> 0:15:44.620000 that you would need for a virtual machine. 0:15:44.620000 --> 0:15:46.920000 I'm going to go ahead and pop into the virtual machine. 0:15:46.920000 --> 0:15:50.900000 And we're going into the monitoring right now. 0:15:50.900000 --> 0:15:53.540000 And I'm just going to slide down. 0:15:53.540000 --> 0:15:57.220000 And I'm going to go first into metrics. 0:15:57.220000 --> 0:16:06.440000 Now, when I go into metrics, I've got the metrics kind of standard graph. 0:16:06.440000 --> 0:16:10.820000 And I've got virtual machine or guest, we've got a virtual machine, I 0:16:10.820000 --> 0:16:13.480000 can select what it is I want. 0:16:13.480000 --> 0:16:16.900000 So let's say, for example, disk read bytes. 0:16:16.900000 --> 0:16:20.100000 And there's my disk read bytes over the last 24 hours. 0:16:20.100000 --> 0:16:25.500000 Go in. And these are the things you're going to get just out of the box. 0:16:25.500000 --> 0:16:29.440000 I don't actually have to do anything at the VM level to get this. 0:16:29.440000 --> 0:16:32.820000 The next level would be boot diagnostics. 0:16:32.820000 --> 0:16:38.160000 Now, if I see boot diagnostics, that means that I am capturing boot diagnostics. 0:16:38.160000 --> 0:16:42.080000 I do get a screenshot in this case, let's get this so we can see a little 0:16:42.080000 --> 0:16:45.460000 bit better. It's probably a little hard to see that screenshot. 0:16:45.460000 --> 0:16:46.940000 It just gives me the login. 0:16:46.940000 --> 0:16:48.540000 That's because this has come up. 0:16:48.540000 --> 0:16:53.480000 It's fine. What's going to be a little more useful potentially is the 0:16:53.480000 --> 0:16:55.080000 serial log here. 0:16:55.080000 --> 0:16:56.840000 And we'll back that down a little bit. 0:16:56.840000 --> 0:17:00.000000 Right where I'm getting, you know, if you've ever booted up a Linux VM, 0:17:00.000000 --> 0:17:01.480000 this should look pretty familiar. 0:17:01.480000 --> 0:17:06.600000 I'm seeing the details, the full details of the boot process. 0:17:06.600000 --> 0:17:10.840000 Now, in order to get this, I actually have to have boot diagnostics turned 0:17:10.840000 --> 0:17:17.200000 on. And I go to the settings, it's on and it's storing into a random storage 0:17:17.200000 --> 0:17:22.280000 account. And it shouldn't be random, but I was just being a little bit 0:17:22.280000 --> 0:17:23.360000 careless with it. 0:17:23.360000 --> 0:17:25.180000 That's boot diagnostics. 0:17:25.180000 --> 0:17:33.740000 Next, I'm going to go to my diagnostic settings. 0:17:33.740000 --> 0:17:38.820000 And here I've got my really detailed diagnostics. 0:17:38.820000 --> 0:17:43.440000 I have these because I have installed the diagnostics extension for this 0:17:43.440000 --> 0:17:47.360000 VM. If I come to this screen and I don't have it, there's literally just 0:17:47.360000 --> 0:17:50.240000 a button that you essentially click to say, yes, I want to install that 0:17:50.240000 --> 0:17:55.900000 extension. Now, what I get is going to be dependent upon the, whether 0:17:55.900000 --> 0:17:59.360000 it is Windows or Linux, as I said, those two are going to be a bit different. 0:17:59.360000 --> 0:18:03.360000 So for example, if I go to metrics, okay, here are my basic metrics. 0:18:03.360000 --> 0:18:07.680000 So it's collecting processor memory network file system and disk, and 0:18:07.680000 --> 0:18:10.440000 it is collecting them every 15 seconds. 0:18:10.440000 --> 0:18:19.720000 I could also go to custom, where I get much more detailed custom captured 0:18:19.720000 --> 0:18:23.200000 data. You see it's capturing every 15 seconds. 0:18:23.200000 --> 0:18:28.080000 And I could delete that, or I could go in and change it, for example, 0:18:28.080000 --> 0:18:31.480000 such as changing that sample rate right there. 0:18:31.480000 --> 0:18:38.780000 So a lot of configuration options, discard, yes, close, here we go. 0:18:38.780000 --> 0:18:41.320000 A lot of configuration options on metrics. 0:18:41.320000 --> 0:18:46.600000 And then I get a similar, you know, configuration for syslog. 0:18:46.600000 --> 0:18:49.480000 These are all the syslog facilities. 0:18:49.480000 --> 0:18:54.660000 And I can set the log level for those syslog utilities. 0:18:54.660000 --> 0:18:58.120000 So many different options there for logging. 0:18:58.120000 --> 0:19:03.560000 This is all being logged into a storage account. 0:19:03.560000 --> 0:19:06.700000 And so you can go to the storage account and you can pick up those logs 0:19:06.700000 --> 0:19:07.480000 from the storage account. 0:19:07.480000 --> 0:19:10.500000 There's also tools that will integrate with that. 0:19:10.500000 --> 0:19:16.140000 For example, if I don't want to install for some reason, the log analytics 0:19:16.140000 --> 0:19:20.220000 agent, you can actually pick this data up from a storage account and drop 0:19:20.220000 --> 0:19:25.180000 it into log analytics through the log analytics configuration itself. 0:19:25.180000 --> 0:19:29.600000 If I want to get rid of all this, I can simply remove this particular 0:19:29.600000 --> 0:19:32.320000 diagnostic extension. 0:19:32.320000 --> 0:19:37.480000 Now the other thing that I can do is I can actually go and install the 0:19:37.480000 --> 0:19:39.840000 log analytics extension. 0:19:39.840000 --> 0:19:41.920000 And I can do this from a number of places. 0:19:41.920000 --> 0:19:47.940000 If it's a Azure VM, I can just go through the blade in the portal. 0:19:47.940000 --> 0:19:53.140000 And I would say, okay, I want that to go into my primary. 0:19:53.140000 --> 0:19:54.260000 And I could enable it. 0:19:54.260000 --> 0:19:58.940000 And what that's going to do is install that extension into my virtual 0:19:58.940000 --> 0:20:01.880000 machine. I can also go through log analytics. 0:20:01.880000 --> 0:20:05.080000 And there is an agent I can download and I can manually configure that 0:20:05.080000 --> 0:20:07.720000 agent. This really does the same thing. 0:20:07.720000 --> 0:20:20.520000 All right, so I'm going to go ahead and go to the second demonstration, 0:20:20.520000 --> 0:20:25.700000 which is capturing an image or capturing in this case. 0:20:25.700000 --> 0:20:29.780000 It's fine. I'm just going to go ahead and capture a snapshot. 0:20:29.780000 --> 0:20:32.640000 Now, if I take a look at this and hopefully it's still up and running, 0:20:32.640000 --> 0:20:38.740000 I've got a rather fragile web app running on this, two lines of Python 0:20:38.740000 --> 0:20:41.540000 code. Hopefully we're still running in this case. 0:20:41.540000 --> 0:20:43.520000 That's not promising. 0:20:43.520000 --> 0:20:46.920000 But I do have some configuration. 0:20:46.920000 --> 0:20:49.560000 I ran it earlier and it ran fine. 0:20:49.560000 --> 0:20:51.460000 I'll probably come up eventually. 0:20:51.460000 --> 0:20:53.560000 But it is configured. 0:20:53.560000 --> 0:20:57.360000 There is custom data there. 0:20:57.360000 --> 0:21:02.460000 And in fact, if I want to connect I copy this. 0:21:02.460000 --> 0:21:04.980000 It come up. There we go. 0:21:04.980000 --> 0:21:12.200000 It did come up. Not exciting, but that's just the name of the server. 0:21:12.200000 --> 0:21:15.000000 And I can see the data there. 0:21:15.000000 --> 0:21:16.200000 I'm going to go ahead. 0:21:16.200000 --> 0:21:27.700000 Let's clear this. 0:21:27.700000 --> 0:21:39.400000 And And see that I do have my web server running on this machine. 0:21:39.400000 --> 0:21:44.340000 So I have a customized machine, but let's say that something is not going 0:21:44.340000 --> 0:21:48.820000 right and I need to create a quick copy of this and test it out. 0:21:48.820000 --> 0:21:51.860000 Now, the way I'm going to create a copy of this is not to take a snapshot 0:21:51.860000 --> 0:22:03.940000 of the and I am going to go to the particular disk. 0:22:03.940000 --> 0:22:04.720000 And then it's pretty simple. 0:22:04.720000 --> 0:22:07.580000 I say, okay, that's the disk I want to take a snapshot of. 0:22:07.580000 --> 0:22:09.260000 I'm going to create a snapshot. 0:22:09.260000 --> 0:22:14.880000 Now, clearly, of course, you can do this through the command line as well. 0:22:14.880000 --> 0:22:17.140000 But here, there's not really much I need to do. 0:22:17.140000 --> 0:22:22.820000 I specify a name and an account type. 0:22:22.820000 --> 0:22:27.740000 How do I want to store this standard premium or not actually going to 0:22:27.740000 --> 0:22:33.740000 create this because I have already done this, but that is the idea. 0:22:33.740000 --> 0:22:37.040000 And what that gives me is this image. 0:22:37.040000 --> 0:22:42.220000 So I earlier took this OS disk snapshot image. 0:22:42.220000 --> 0:22:45.560000 And what I want to do now is I actually want to create a virtual machine 0:22:45.560000 --> 0:22:48.560000 based on the snapshot. 0:22:48.560000 --> 0:22:54.560000 So to do that, first, I need to create a managed disk. 0:22:54.560000 --> 0:23:00.040000 We go to manage disks. 0:23:00.040000 --> 0:23:05.820000 I'm going to put this in my image demo. 0:23:05.820000 --> 0:23:14.500000 The managed disk name is going to be test web disk. 0:23:14.500000 --> 0:23:19.180000 That's going to go into east us of availability zones. 0:23:19.180000 --> 0:23:23.860000 And what's really important here, source type snapshot. 0:23:23.860000 --> 0:23:27.680000 And there's my snapshot. 0:23:27.680000 --> 0:23:32.100000 And I can change the size of this. 0:23:32.100000 --> 0:23:37.480000 I do not need that bit with 128 gig. 0:23:37.480000 --> 0:23:40.280000 Believe it premium, that's fine. 0:23:40.280000 --> 0:23:45.420000 And create. Review and create. 0:23:45.420000 --> 0:23:46.620000 Create. All right. 0:23:46.620000 --> 0:23:50.420000 So that's going to take a moment for that managed disk to create once 0:23:50.420000 --> 0:23:55.360000 that stuff come back and create a virtual machine based on it. 0:23:55.360000 --> 0:24:05.240000 All right. My OS disk or my managed disk, which is an OS disk, is now 0:24:05.240000 --> 0:24:09.200000 generated from the snapshot. 0:24:09.200000 --> 0:24:12.020000 So what I want to do is go over to the disk. 0:24:12.020000 --> 0:24:17.160000 And now it's pretty cool is that right from the managed disk, I can create 0:24:17.160000 --> 0:24:18.600000 a VM based on that disk. 0:24:18.600000 --> 0:24:19.680000 So that's what I'm going to do. 0:24:19.680000 --> 0:24:21.580000 I'm going to go ahead and create a VM. 0:24:21.580000 --> 0:24:29.880000 And my virtual machine name is going to be test VM. 0:24:29.880000 --> 0:24:34.320000 I should say test web VM. 0:24:34.320000 --> 0:24:39.420000 And let's see, we've got the image, test web disk. 0:24:39.420000 --> 0:24:44.060000 I set a size for this and I will pick my absolute favorite size. 0:24:44.060000 --> 0:24:47.080000 It's very weird that I have a favorite size, but I do. 0:24:47.080000 --> 0:24:50.520000 All right, we're going to let those in. 0:24:50.520000 --> 0:24:58.240000 Discs, premium, networking, I'm going to go ahead and put it on the same 0:24:58.240000 --> 0:25:01.640000 network. And again, oftentimes you probably wouldn't, right, because you 0:25:01.640000 --> 0:25:03.280000 want to test this out and maybe separate. 0:25:03.280000 --> 0:25:04.620000 We'll leave it as is. 0:25:04.620000 --> 0:25:08.140000 My boot diagnostics, don't need anything there. 0:25:08.140000 --> 0:25:11.880000 I'm going to go ahead, review and create. 0:25:11.880000 --> 0:25:15.160000 And then I am going to create. 0:25:15.160000 --> 0:25:20.040000 All right. And so now I am creating a virtual machine. 0:25:20.040000 --> 0:25:22.480000 So we'll let that turn a little bit. 0:25:22.480000 --> 0:25:24.760000 And once it's done creating, I'm going to pop into it. 0:25:24.760000 --> 0:25:41.780000 I'm going to connect to that virtual machine. 0:25:41.780000 --> 0:25:45.180000 I'm going to go over here and hit connect. 0:25:45.180000 --> 0:25:47.720000 I just want to make sure it's got the software on it, the very complex 0:25:47.720000 --> 0:25:51.460000 software that was installed previously. 0:25:51.460000 --> 0:26:08.080000 So what I'm going to do is I'm going to click on the settings. 0:26:08.080000 --> 0:26:15.560000 And I'm going to see why my connection was refused. 0:26:15.560000 --> 0:26:23.600000 Make sure I've got all the right settings here. 0:26:23.600000 --> 0:26:28.580000 It should be getting 22 in. 0:26:28.580000 --> 0:26:36.660000 And oh, it did not yet pick up the computer name. 0:26:36.660000 --> 0:26:37.880000 Ah, any agent status. 0:26:37.880000 --> 0:26:42.520000 And I read, OK, it's not actually fully started yet. 0:26:42.520000 --> 0:26:48.460000 But we will give it another couple of moments to get fully up and running. 0:26:48.460000 --> 0:26:51.720000 And we'll come back and I'll show you how to connect. 0:26:51.720000 --> 0:26:57.660000 All right, let's give that another shot. 0:26:57.660000 --> 0:27:02.660000 I haven't done anything other than I just waited for a moment there. 0:27:02.660000 --> 0:27:03.620000 And there we go. 0:27:03.620000 --> 0:27:06.300000 It's now going to let me connect. 0:27:06.300000 --> 0:27:12.400000 And I am connecting, by the way, with the same username and password that 0:27:12.400000 --> 0:27:16.960000 I used with the original virtual machine. 0:27:16.960000 --> 0:27:18.520000 So I think I am. 0:27:18.520000 --> 0:27:23.380000 I type it in right and I'm not typing it in right, which means I've forgotten 0:27:23.380000 --> 0:27:25.600000 it. But that's OK. 0:27:25.600000 --> 0:27:28.760000 Because I can cheat and show you something actually pretty cool. 0:27:28.760000 --> 0:27:32.980000 When things go awry, it does work. 0:27:32.980000 --> 0:27:36.100000 I just forgot what the password was. 0:27:36.100000 --> 0:27:39.960000 I think I used a different one than my normal password. 0:27:39.960000 --> 0:27:46.620000 All right, and let's go with this is kind of nice. 0:27:46.620000 --> 0:27:50.300000 Not that you'll ever need to do this, but if you ever do forget the password 0:27:50.300000 --> 0:27:54.500000 on a virtual machine, you can reset the password. 0:27:54.500000 --> 0:27:58.300000 Please don't, something you don't want to have to do, but it is something 0:27:58.300000 --> 0:28:00.820000 that you can do as necessary. 0:28:00.820000 --> 0:28:06.360000 So let's give that just a moment. 0:28:06.360000 --> 0:28:12.100000 All right, it says that it updated. 0:28:12.100000 --> 0:28:13.260000 I'm getting a warning here. 0:28:13.260000 --> 0:28:18.480000 So let's try this again. 0:28:18.480000 --> 0:28:28.080000 There we go. I am now connected to that virtual machine. 0:28:28.080000 --> 0:28:35.860000 And again, that was me for getting now I've got the virtual machine and 0:28:35.860000 --> 0:28:39.080000 I can do things, for example, like ls. 0:28:39.080000 --> 0:28:45.200000 Web server, that's my web server and I could go sudo. 0:28:45.200000 --> 0:28:48.680000 Well, let's see here. 0:28:48.680000 --> 0:29:00.620000 Let's go Python three. 0:29:00.620000 --> 0:29:02.820000 And that's going to run the web server. 0:29:02.820000 --> 0:29:11.700000 And then if I want to go ps, ox, rep, web, I can see the web server's 0:29:11.700000 --> 0:29:14.640000 running. Then I could go in and I could start working with it. 0:29:14.640000 --> 0:29:18.420000 All right, what is key here is that I've been able to provision and startup 0:29:18.420000 --> 0:29:25.820000 a virtual machine based on the snapshot of another virtual machine. 0:29:25.820000 --> 0:29:29.540000 I could also go in, for example, at this point, let's say, okay, this 0:29:29.540000 --> 0:29:35.180000 is what I want, I could create an image of this and then I could create 0:29:35.180000 --> 0:29:37.520000 multiple instances based on that image. 0:29:37.520000 --> 0:29:39.940000 And I'll tell you what, since there was a little bit of a hiccup there, 0:29:39.940000 --> 0:29:41.420000 we'll give you a little bit of a bonus. 0:29:41.420000 --> 0:29:46.560000 I'm going to show you what you would have to do to make this an actual 0:29:46.560000 --> 0:29:55.000000 image. And it's actually really not very complex. 0:29:55.000000 --> 0:29:58.380000 I just need to run one command. 0:29:58.380000 --> 0:30:03.820000 And I'm going to get that command and we'll run it in just one moment. 0:30:03.820000 --> 0:30:11.740000 All right, what I'm going to do is I'm going to take this incredibly well 0:30:11.740000 --> 0:30:14.660000 -defined virtual machine here and I'm going to make an image of it. 0:30:14.660000 --> 0:30:15.560000 I'm not going to wait for the image. 0:30:15.560000 --> 0:30:18.460000 I just want to show you the quick steps because it's really not that hard 0:30:18.460000 --> 0:30:21.540000 to do. And you can look this up and get this, but this way you'll see 0:30:21.540000 --> 0:30:22.620000 what I'm talking about. 0:30:22.620000 --> 0:30:27.600000 The first thing I need to do is I need to actually generalize the OS. 0:30:27.600000 --> 0:30:34.980000 And to do that, I am going to run, you can see here, sudo wa agent force 0:30:34.980000 --> 0:30:37.460000 and deprovision. 0:30:37.460000 --> 0:30:45.420000 And I need to put in the password. 0:30:45.420000 --> 0:30:50.660000 And that's going to run that and it still doesn't like my password. 0:30:50.660000 --> 0:30:58.380000 There we go. All right. 0:30:58.380000 --> 0:31:03.580000 And so that is, you can see all the things that it's doing. 0:31:03.580000 --> 0:31:05.100000 The agent is going to be stopped. 0:31:05.100000 --> 0:31:08.620000 Least is deleted, root password disabled, and not be able to log in his 0:31:08.620000 --> 0:31:13.980000 root. And it's not going to remove the resolve. 0:31:13.980000 --> 0:31:15.480000 But that gets it ready. 0:31:15.480000 --> 0:31:26.100000 You can also run an export to clear your history. 0:31:26.100000 --> 0:31:34.560000 And so then that's all I need to do for the actual OS. 0:31:34.560000 --> 0:31:41.760000 And then what I would do is I would go over here to the virtual machine. 0:31:41.760000 --> 0:31:44.400000 It's actually pretty simple. 0:31:44.400000 --> 0:31:46.740000 And I would go to capture. 0:31:46.740000 --> 0:31:48.480000 I click capture. 0:31:48.480000 --> 0:31:53.420000 And what that's going to do is create an image for me. 0:31:53.420000 --> 0:31:59.280000 Okay, so it is going to generalize the disk and create the image all in 0:31:59.280000 --> 0:32:00.600000 one step. And that's it. 0:32:00.600000 --> 0:32:02.000000 I can go ahead and hit create. 0:32:02.000000 --> 0:32:04.280000 I'm not going to wait around for that image to be created. 0:32:04.280000 --> 0:32:09.140000 But once you've created an image, oh, I have to type the virtual machine 0:32:09.140000 --> 0:32:14.840000 name, which is test web VM. 0:32:14.840000 --> 0:32:20.600000 And once I do that, I create that and I get an image. 0:32:20.600000 --> 0:32:23.520000 I can go to the image, I can actually go through resource manager, go 0:32:23.520000 --> 0:32:26.520000 to the image and create a virtual machine based on that. 0:32:26.520000 --> 0:32:29.440000 Or I can go and just create a virtual machine and just specify that I 0:32:29.440000 --> 0:32:31.740000 want to use this image. 0:32:31.740000 --> 0:32:33.720000 It's a really fairly straightforward process. 0:32:33.720000 --> 0:32:38.320000 Again, the only thing with creating the image is that you have to consider 0:32:38.320000 --> 0:32:41.900000 whether it's a Windows or if it's a Linux VM, you're just going to have 0:32:41.900000 --> 0:32:43.340000 to do a little bit of quick research. 0:32:43.340000 --> 0:32:46.960000 It'll be a variation of what I just showed you on Linux using that WA 0:32:46.960000 --> 0:32:49.380000 agent to generalize the OS.