Microsoft Azure AZ-800 — Section 11: Manage Hyper-V and guest virtual machines Part 6

Microsoft Azure AZ-800 — Section 11: Manage Hyper-V and guest virtual machines Part 6

92. Manage VHD and VHDX files

I didn’t like to talk to you about the concept of VR in VR HD eight X files now of HD video X. These are virtual hard disk files and of course they are needed in order to store information for your virtual machines. When you go to create a virtual machine, if I say new virtual hard drive or virtual machine, if I click next, I give the machine a name. But if I click through to the virtual hard disk area, you’ll see there’s an option. This create a new virtual hard drive. Use an existing one or attach one later. You’re not really given a whole lot of options right here. You basically are going to create what’s called a dynamically expanding disk, and it’s going to do the HD X. But if I create one ahead of time, I have more features available to me.

So let me hit cancel and I’m going to click new hard disk.

OK? From there, I’m going to click next. On the welcome screen, you’ll see I have three options. The old format is the video format. The HD format came out years ago when they initially created this concept, which originally this would be something called virtual. DC and Microsoft bought the rights to virtual PC from the company that created it, and then Microsoft created virtual server and then eventually it became Hyper-V. This around the twenty eight time period, and all that existed was virtually within a few years goes by. They came out with a server. 2012 they released the Hyper-V to support the HD. Files could be no more than two terabytes in size, whereas VA X can be up to 64 terabytes in size.

Now there’s also what is known as a VA. HD said Avi HD set is a feature that is used for what are known as shared hard drives, not something. We really get into a lot in this course, but you can set up something known as an AI scuzzy, shared volume and basically what it is. It’s a virtual hard drive that can be stored on a file server, and you can have multiple virtual machines that are communicating with that that shared virtual hard drives simultaneously if you want it to. And they could all be storing data. And it’s great for like database scenarios where maybe you had a bunch of virtual machines that were tied to a central database, you would use a VR headset for that, OK? In my case, I’m going to go with VA HD X here. We’re going to click next, and then we get to this next screen where it says, choose the disk type.

So now this the probably the most important I would say of working with videos is understanding the different types of video video files.

So, we or disc types, what we’re looking at here, there are three options. The first one is called a fixed disk. A fixed disk is a disk that is a static virtual disk. That means that when you set the size of the disk, it is always going to be that size and it will basically max out at that size.

So, for example, if I said it to 128 gigs, then it’s going to consume exactly 128 gigs of Hargrove space on the Hyper-V computer.

OK, now you are going to get the best performance of the three options. You’re going to get the best performance using a fixed disk because the disk is a set size, it’s not going to be growing or anything like that.

So, it’s you’re going to get better performance than if you go with one of these other ones. The second one here is called a dynamically expanding disk, and a dynamically expanding disk is a disk that will use the minimum amount of actual hard drive space, but will grow into what a reset the size to.

So, in other words, if I set the size to 128 gigs, then it will show through to the virtual machine that it has 128 gigs of disk space, but it’s only going to actually consume the amount of disk space that’s being utilized by the drive.

So, if you’re only storing ten gigs of data on the drive, it’s only actually taking ten gigs of data on the physical Hyper-V machine. And so the great thing about that is that you’re able to kind of conserve disk space. The downside of that is, is that it you don’t get as good a performance with this type of disk because every time new data is being added, it has to expand the disk and it slows things down a little bit.

So, it’s great for lab environments, things like that kind of like what we’re doing here, but ultimately it’s not good for production environments. Fixed disk is really what you want to go with on a production environment. And then finally, that brings us to a different thing disk and different thing. Disk is going to take a little bit of explaining might have to draw something out for you to try to help you understand this, let’s jump over and draw this out real quick. First off, with the difference in disk, you have to actually have a parent to this disk and the parent can either be a fixed is caught dynamically expanding disk in. In fact, a different thing, this actually what gets created if you ever use checkpoints as well, but this kind of illustrate what I’m saying, OK, let’s say that we set up a virtual machine. That. Let’s say this our virtual machine. Maybe, it’s going to be running Windows 10. All right. And we have a disk on this drive here or on this virtual machine. This little cylinder is going to represent a disk here and this disk is a video file.

OK. And this, we’re going to say, just a fixed or dynamic, really expanding disk.

OK. And this what we’re going to call the parent disk.

Now we let’s say we’ve installed Windows 10 on this disk for maybe this a virtual machine and we maybe let’s say we work for a school or a university. We have a computer lab or something like that, and we want each student to have a replica of this virtual machine. Maybe, there’s a imagine a computer lab at a school and there’s a bunch of machines that when they boot up, maybe they’re thin clients and they’re going to connect into these virtual machines remotely. And essentially what we want to do is we want to have this kind of like our template virtual machine and we want to have replicas of this that basically get reverted back to the original state at the end of a semester or the end of a certain class period.

OK.

So, you know, we could copy and paste this over and over and over and all of that. However, we can do something really interesting. We can actually create different sing disk. All right. Let me just copy this, actually. Let’s just do for OK. These will be different seeing disks instead of dynamically expanding or fixed, and these differences thing disk our child disks, they can be set up as child disk of a parent disk. All right, so, they are actually child disk of this parent disk.

Now, whenever you do this, as soon as you pair different depressing disk with a packet with a fixed or dynamic disk, that disk immediately then becomes read only. All right, so what you can then do is you can associate virtual machines with these disk if you want.

So each one of these could be a different virtual machine.

So this could be, you know, VM one. This could be VM too. This can be VM three. This could be VM four. And this up here, maybe this the VM parent. And so what happens is, is you’ve got a Windows 10 installed here. And then as your as your lots of students or users are using these virtual machines, all changes they make are happening to this video file right here. Instead of the parent, the parent is read only in any changes that are made are going to happen into the difference in disk.

So the benefit of this allows you to scale out and have a lot of virtual machines off of one parent that is read only and all changes to be stored into that different disk. And essentially, it allows multiple users to have the same experience, even though they’re able to store their own individual information into a separate disk. The users are not even going to know this happening now at the end of this, let’s say, the end of the semester or whatever it may be, we can just revert all of this back to the parent and then everything goes back to the way it was with the initial Windows 10 setup. All right.

So different than disk or something that’s not used that often other one. Then with checkpoints, they’re really not used that often they’re used in lab environments, classroom environments, things like that. But ultimately, you wouldn’t use these a lot in a production environment. Kendall jumping back over into my Hyper-V wizard here I choose dynamic expanding. I’m going to click next and this OK, what do you want to call this? All right, so, I’m going to call this dynamic disk demo, and that’s what I’m going to name the disk. We’ll click next and then says, All right, how much space do you want to give it? So you can see it. This defaults to one hundred twenty seven gigs and I can set that to whatever I want up to sixty four terabytes. And then from there, says Copy the contents. First specify physical disk. If we had a physical disk, we wanted to copy the contents into a disk we could. That’s kind of neat. If you wanted to associate a physical disk, if you had a disk in the machine, you want to copy all the contents into that you could. Or if you wanted to copy the contents of the specified virtual hard disk to a certain path, you could you could have you could change the path here. Specified different location for it. I’m going to choose create a new blank virtual hard disk. All right. And instead of pointing to a physical disk or pointing to an existing video and copying contents, I’m going to click next and click finish. And just like that, we’ve now officially created ourselves a dynamically expanding disk. And if we wanted to, we could create a new, let’s say we’re going to create a new virtual hard disk of our new virtual machine. We can click next all the way through it. Let’s just call this VM two and we can click next all the way through to where the virtual hard disk areas I can so use an existing virtual hard disk if we want to, and then we could specify that as our disk, right? And so that’s that’s where that comes in. All right.

So at that point, I could click next, click finish. And I’ve now officially associated a created a new virtual machine and associated an existing video file to that virtual machine.

Now, if I wanted to link a create a different thing disc and link that to that that parent disk that I just created, I can do that. I can click new the hard disk. Click Next. The HD X Next Different thing next. And so this to specify the name is going to call this different seeing demo. All right. And then from there says, OK, where you want to store it videos. Click next.

Now, where is the parent? So, so specify the virtual hard disk that you want to use as the parent.

So browse and we’ll choose dynamic. This demo, we’re going to click next and then finish, and we’ve now officially linked that difference in disk to it. Right? So, if I wanted to now, I could create a new VM and I could use the different thing disk as the disk that I’m going to. And then whatever that parent is, has and it would would be read only to this death course, I would want to associate that to this VM because it’s now read only, but you could do exactly what I showed you in my diagram. All in all, working with this pretty easy. There’s also horse PowerShell commands that we can use for creating virtual hard disk as well.

OK, I’m now going to right click start and I’m going to click on Windows PowerShell admin if I want to view my videos first thing I want to do, I need to know where my videos are stored, which is the sequel and slash videos, right? And then there is my video files as well, of course, the file extensions being hidden. But if I come over here to view, I can say show the file extensions and there is the file extensions, right? So, if I want to view those, I can.

So, if I just type, go here to PowerShell and type get -video and then -Path C Colon Slash VA DS and then. Just type in the name of the disk, you can view the disc that way gives you information. If you wanted to create a V HD, then the process for that would be new -v HD new -v HD -path. Specify the path will say cycle and slash Ph.Ds, and we’ll just call this. We’ll just call it PowerShell. Demo disc. All right. Dot v HD X. All right, and then we can specify the size bytes. All right. And I’ll just do. Let’s just do 10 gigabytes.

OK, now if you do want to make this a different thing, this there’s a dash. You can do nine -and make you -different saying you can essentially. Also, if you wanted to do -fixed, you can do -Fix.

So there’s a few different of these. I’m going to do -Dynamic. We’re going to hit Enter and hopefully created the disc successfully. As you can see it, it appears as though it did.

So, we can go to File Explorer and there it is. There’s my disk, So, it’s a dynamically expanding disk that’ll max out at ten gigs. All right. And then what? From there, if I wanted to, I could go up to a virtual machine, for example, VM one, I could go to settings and I can see the hard drive associated with VM one here. If I wanted to click, click knew I could. Next, right, dynamically expanding, you could create a disc that way if you want, if you wanted to add another way of doing this instead of adjusting this hard drive, you can click on the controller. Click Add, and then you can just browse. To this other disc. And apply that now. And now this computer, this virtual machine would actually have two hard drives that would have the first hard drive and then also the second one, which would be 10 gigs, and it would appear in the virtual machine as though it was a physical hard drive.

OK. And that’ll work. Both with this the I.D. controller, but it would work with the scuzzy controller on here as well. All right. But all in all, I think you’ll find working with your virtual hard drives are pretty straightforward. It’s definitely something to kind of play around with and get a feel for it.