Join Ed Liberman for an in-depth discussion in this video Creating VHDs, part of Windows Server 2016: Configure Hyper-V.
- [Instructor] Just as a physical computer stores data out on a physical hard disk, a virtual machine stores data on a virtual hard disk which, interestingly enough, is actually a set of files that resides on a physical hard disk. Now there are different types of virtual hard disks that we can work with, so let's get in here and take a look at some of these. So, to do this I am on a computer that I have here that is running Windows Server 2016 and has the Hyper-V role already installed.
So here in the Server Manager, let's go up to the Tools menu, and select the Hyper-V Manager. Here in the Hyper-V Manager, you'll see here that we have HOST-1 which is the host that is running Hyper-V and on this Hyper-V host, we do have a virtual machine that we've already created called Demo VM. So there's a couple different things I want to show you. Let's start off by coming over here to HOST-1 and if I right-click on it and select New you'll see here I have the ability to create a new hard disk and when I select that it takes me into the New Virtual Hard Disk Wizard, I get a basic overview Before You Begin screen.
Let's just click Next through that. Now I get to choose a disk format. The two basic formats we have are either VHD or VHDx. VHD supports disks up to 2,000 gigabytes in size, whereas VHDx supports disks that are up to 64 terabytes in size and are also resilient to consistency issues that sometimes happen when we have power failures and things like that. The bottom line here is that VHDx is bigger, faster, better, et cetera, et cetera, but it's only supported if you're using an operating system of Windows Server 2012 or newer.
So that's kind of the short answer as to which one of these two you should select. If you're going with an older operating system, then you got to go with the older VHD file, newer, VHDx. Now there is a third choice here and that is something called a VHD Set which has to do with shared virtual hard disks. In Windows Server 2012 R2 we were introduced to shared VHDx files where we could have virtual machines that are sharing a VHD file.
Well, now in Windows Server 2016, they actually created something called the VHD Set. It helps not only to be able to use shared virtual hard disks, but it also enables backup of virtual machine groups that are using these disks, but again, you must have at least it says here Windows 10 or Windows Server 2016. All right, so we're going to select VHDx and then I'll click Next and I need to choose a disk type. If we choose Fixed size that means that the actual virtual disk will tie up as much physical disk space as whatever its size is.
Okay, it just is created and it just kind of locks in that space. It's not very efficient when it comes to disk space utilization, but you do get better performance. So if disk read write performance is an issue on the machine you're working with, then you're going to want to go with the fixed size disk. Typically, though, you would go with the dynamically expanding disk where you get better use of the physical resources and the reason why is because you can actually create a disk that is larger than what you physically have available.
Now eventually it could cause a problem as it starts to fill up, but when it's first created, it ends up being very small initially and then grows as you need it. And then we also have a differencing disk. Now this is a type of disk that has a parent child relationship where you have to have an actual parent disk that's already created. So an actual VHD before the one that we're creating now and the differencing disk is just that. The base will already be created and then here this disk would be only for changes.
So I'm going to take the dynamically expanding choice here and click Next and now I need to give it a name. I'm just going to call this Another VHD for Virtual Hard Disk and the location, we'll just take the default location. Right, which is already established and I'll click Next. I need to give it a size. Now you can see my physical hard drive is actually only 200 gig, but yet I could actually make this bigger if I wanted to, if I made that 500 gig it would still work and the reason why is because it is dynamically expanding, it wouldn't start off by being 500 gig.
That's not a good idea unless you know that you're about to go create some more storage. You go out there and buy a bigger hard drive or something. The default is 127 gig, I'll just leave it there for now. I could also copy the contents of an actual physical disk if I wanted to, if I wanted to take a certain physical disk that already maybe had images on it and things like that, I could copy them over or I could copy from some other virtual hard disk, but I'm just going to create a new one here.
I'll click Next. And here is a summary of what we're about to do. So I'll click Finish. And you don't see anything change here, but I did indeed create another virtual hard disk that could be used by my virtual machines. So, when I created the virtual machine, this Demo VM here, I had the option of connecting to a VHD or created one. Now, if I already had created them, like I just did, I could have connected to it.
But because I didn't have any created at the time, I just created a new one and it actually has the same name, it's Demo VM VHD. So let me right-click on Demo VM here and go into the settings for this virtual machine. And we're going to look at one specific setting and that is the hard drive, cause I want you to see here that it is connected to a virtual hard disk and that virtual hard disk is Demo VM.vhdx and this is another place where I could go ahead and create a new virtual hard disk, or I could edit the details of this one, so if I click on Edit and it gives you a little warning here you know, this could be creating a problem, and we'll say okay, we're aware of that, I'll click Next.
You'll see here that I can compact it, I can convert it and if I convert it, you'll see here that it brings up some options where I can go to different formats and types, just like I did in the previous wizard and I could also expand it if I wanted to grow it. So, I'm going to actually cancel out of this wizard, I'm not looking to do any of those things, I just wanted to show you that that can be done. I will also show you that if I wanted to add a new drive, if I highlight my SCSI controller here, I can go ahead and add a hard drive and this is where I could browse and you'll see here there's that Demo VM, the Demo VM that originally was created when I built this virtual machine and then here's another VHD.
So if I double-click on that and then Apply, you'll see here that I now have two hard drives on this virtual machine. All right, so again, just kind of to remind you some people struggle to wrap their brain around this, so just to help you wrap your brain around this, a physical computer has a physical hard drive, we're dealing with virtual computers, they're actually called virtual machines so they will use virtual hard drives and a virtual machine is just files on an actual computer.
Well, likewise a virtual hard drive is just files on a physical hard drive.
This course maps to the third domain of Exam 70-743, Upgrading Your Skills to MCSA: Windows Server 2016—Implement Hyper-V.
- Installing the Hyper-V role
- Creating virtual switches and virtual machines
- Installing a guest OS
- Managing checkpoints
- Implementing storage migration
- Implementing live migration