Skip to content
CBT Nuggets
DemoBook a Demo

Hyper-V Memory, Integration Services, Discrete Device Assignment, and Resource Groups

This skill covers essential aspects of managing Hyper-V environments, including configuring virtual machine (VM) memory, integration services, and discrete device assignment. It also delves into the use of VM resource groups for efficient management and automation of tasks across multiple VMs. The skill emphasizes the use of PowerShell cmdlets for configuration and management, providing practical examples and detailed explanations to enhance understanding and application in real-world scenarios.

Full skill from Hyper-V. Preview the training IT teams trust.

Updated

49m

Skill 2 of 5 in Hyper-V

What you'll learn

  • Explain how VM memory consumption during startup and restart cycles in VDI environments can deplete host physical memory and degrade performance
  • Check guest operating system status and Integration Services status from the Hyper-V host using PowerShell
  • Describe the Time Synchronization and Data Exchange integration services and when to leave time sync enabled
  • Identify Discrete Device Assignment requirements, including supported GPU and NVMe devices, Gen 1 or Gen 2 VMs, and Windows Server 2012 R2 or greater
  • Configure VM resource groups to run repeatable tasks, such as creating a checkpoint across all web servers before an app deployment

Free 49-minute video lesson with a full transcript and knowledge checks. No account needed to watch.

Overview

Join James Conrad as he demonstrates how to configure VM memory, integration services, discrete device assignment, and VM resource groups.

Recommended Experience

  • An understanding of concepts taught in CompTIA A+
  • Two years of hands-on experience working in a server environment is recommended

Related Certification

  • CompTIA Server+ (SK0-005)

Related Job Functions

  • Systems Administrator
  • Server Administrator
  • Network Administrator
  • Data Center Technician
  • Data Center Engineer

James Conrad has been a CBT Nuggets trainer since 2020 and holds a variety of certifications including Microsoft Certified Professional, Microsoft Certified Solutions Associate, Microsoft Certified Solutions Expert, Microsoft Certified Technician, Certified Ethical Hacker, and CompTIA A+.

Configure VM Memory

In this Nugget, we learn how to configure virtual machine memory.

Knowledge Check

You configure a VM memory setting to RAM: 2048. However, when you check the actual memory in use, it shows 4096. Why?

Configure Integration Services

In this Nugget, we learn the advantages of integration services and how to configure them.

Knowledge Check

Which of the following does configuring the Integration Services "Guest services" setting do?

Configure Discrete Device Assignment

In this Nugget, we learn how to assign a device direct access from a VM.

Knowledge Check

Which BIOS setting would you enable to use discrete device assignment?

Configure VM Resource Groups

The only way to configure a VM resource group is via PowerShell cmdlets.

Knowledge Check

The only way to configure a VM resource group is via PowerShell cmdlets. True or false?

Conclusion

I hope this has been informative for you and I would like to thank you for consuming.

View Transcript

Configure VM Memory

0:00[MUSIC PLAYING] Hey. Are you forgetting something? Ha! I know when you get to be my age, you always feel like you're forgetting something. There's something that I forgot to do. I should have put it on my to-do list and I didn't. Yesterday, I walked into the garage, and I stood there in the middle of the garage for probably a solid minute. What did I come in here for? I never could remember. Anyway, we all need more memory or maybe better memory from time to time, other than a couple of friends of mine who have photographic memories.

0:35I think I hate them. Then we all need some more memory. Now of course, we're not talking about human memory here. We're talking about physical memory and/or in this case, virtual memory. And of course, I'm really talking about virtual machine memory, not virtual memory. That's kind of another topic. So, how does all this work out? You know how things go on a physical level. On this machine I'm recording from right now, I have 64 gigabytes, and I don't have to use all of that all the time. A lot of it will go to virtual machines that I run.

1:06So, I might have Hyper-V running here with virtual machines running in it. And I've got this virtual machine, and this one, and this one. And maybe this is a server down here, and maybe it needs, oh, let's say, eight gigabytes. Maybe this one's just a Windows 10 computer. It needs two gigabytes. And this one over here maybe is a Linux machine, that maybe we decide it needs two gigabytes as well. What does that add it up to, 12? So, does that mean that this over here is actually 52 gigabytes that are left?

1:37And how does that get balanced out? This machine over here is also going to have a paging file, which is substituting memory in hard disk paging instead. I think you may already be familiar with that. The virtual machine is here also though. Even inside of them is, for example, this server down here that's using eight gigabytes. What if it has a combination of applications and different things that it's doing and data that's processing, where now, oh no, it needs 10 gigabytes total, but I only gave it eight? Now what? Well, a couple of different things. Number one, it can use paging on its own within that.

2:11But the virtual machine management here, actually Hyper-V itself, can also allocate memory in various ways. And one of the ways that it can do that is through something called dynamic memory. Now, in addition to that, there are other things that happen when a computer starts up as a virtual machine. Actually, this is true of physical machines as well as virtual machines. And it's mostly true of Windows, but it probably also applies to most other operating systems. And that is, it uses more memory during the full startup process, and then once it's at rest, it usually calms down.

2:45So, these virtual machines here, let's say these two gigabyte ones, let's say if this is a Windows 10 or 11 machine, it might use 1 and 1/2 or two gigabytes during the startup. I don't really know the exact amount that it's going to use. They're all going to be different depending upon their load. But after a while, it might go way up here to two gigabytes, and then after 10 minutes or so it might come back down to one gigabyte. That it's really using at rest, so to speak. This becomes a factor when you're working with VDI or virtual desktops.

3:17This would be where, for example, someone's sitting at home. Let's say this is their-- I don't know why I'm writing a triangle for someone's home, and I'm in the way. But this is their home down here, and they're working on their-- maybe it's an old, crusty laptop computer, sitting on their couch because everybody works from home these days, or a lot of people do anyway. That's not a window. It's supposed to be a laptop. There's the keys on it and everything. Anyway, they're working from here. And it's really just enough to get started. It's a bring your own device kind of a situation, but they need to be able to use this virtual machine right here.

3:48And that again would be the case if I'm using VDI, which, by the way, stands for virtual desk infrastructure. And if you're using something like that, you probably have a bunch of other desktop computers here. These are all, let's say, VDI machines that other users will be connecting to throughout the day. What's the advantage of a VDI? And we're not really talking about VDI per se here today on its own, but it does affect how memory gets used. So, let's discuss it in a virtualization environment. The advantage of VDI is that these desktops will be corporate desktops that have a lot of our wallpaper, configuration, all of our apps, everything like that.

4:25That means that we don't have to have an administrator, and this is the worst case, traveling to this person's house, configuring their personal desktop to have only exactly what we need. No, that would be very impractical. So, instead we configure all these VDI machines here, and it's the exact image of our corporate desktop that we want with all the apps that they need and everything. So, we might have quite an infrastructure where there's quite a few people connecting to these VDIs. As you can imagine, that's going to consume a lot of memory as the day goes by. And this gets to be more complex as these machines not only start, but also as they restart, because again, it might have gone up to two gigabytes at a certain point, then it went down to one gigabyte.

5:05But then the user restarts the computer, so it again it has to go into this cycle, where it goes back up to two gigabytes and down to one or whatever. Well, as all of these machines start to consume memory, our physical memory in our host machine can start to go down, down, down until we get into kind of a memory depleted situation. And maybe we're paging too much now and performance will already start to suffer. And there are even situations in which maybe we have something going on where a lot of these machines are rebooting at once and all going through this memory spike where they have to consume all of their memory. We might even start to get error messages that there is insufficient memory to restart a computer, and even that is not really quite how it happens.

5:43What happens, is now in modern versions of Hyper-V operating systems is that it's going to use something called smart paging. And smart paging only happens when virtual machines are being restarted, and there's no physical memory available to give us this increase right here that we might need, and when it cannot be reclaimed from any of these other virtual machines, and they don't have any memory to give up or to borrow from. Also, be aware of the fact this only applies to actual restarts. If a machine is doing a cold start, a virtual machine's a cold start from an off position, then this is no longer a factor.

6:18It just restarts. And to illustrate some of this, I've gone to my own Hyper-V here. Now, this is running on a Windows 11 computer, but everything I'm going to show you here is going to be the same, whether it's on 11, server 2008, R2, 2016, 2019, server 2022. All of those are going to be the same, Windows 10. So, what we can do here is we can right click there to go to settings, and if we go into memory right here, we could get a little bit more detail. And some of this is a little bit misleading. Let me talk to you about what's really going on here in terms of the memory allocation.

6:48Now, first of all, think about a physical machine. Let's say a physical machine had only two gigs of RAM. That's not very much these days, but let's say it had two gigabytes of RAM. Well, it's probably got a couple of memory modules in there, and the entire time that that machine is turned on and running and the operating system is going, it's got two gigabytes constantly. And it will play around with how much of that two gigabytes it actually needs for its operating system and applications. But you don't just rip out a memory module while the machine is powered and turned on in most cases, unless you want to have a really bad day.

7:19Well, when it comes to a virtual machine in Hyper-V, it really actually has those two gigabytes that we see here during startup. This probably should be renamed not to just RAM, but to startup RAM. That's how much is allocated during startup. That will give a better performance during the startup process because most operating systems will require more RAM during startup, and then after a minute or two or a few minutes, it will kind of settle down and go back down again. So, we start up. We go on the run-up. As the computer boots up, you run up and you get up to this 2048 and it needs that for a few minutes.

7:54And then again in a VDI situation, where you'll have, gosh, maybe dozens of machines that are really just idle, nobody's connecting. Maybe it's not our business hours or whatever. They're available if somebody does need to connect to it in the middle of the night, they forgot to do something. But it could be that they're just kind of sitting there. And in that case, they'll relinquish memory up to as little as 512 megabytes in this case. Now, that's operating system dependent as well. If we're running Windows 11 VDIs, and I don't know what the minimum is, but let's say it can only go as low as 700 megabytes, then it won't go quite as low as this.

8:30But let's just for the sake of argument say that it goes all the way down to 512. Well, now as the user starts to use more memory, they come in the morning, they log on, they start up their VDI. Then they got some applications running. Now they need this much memory. Now they have an issue that's come up and they need to restart their machine. On restart again, it can use that smart paging in order to get memory that it might need. And it'll create a temporary paging file that's not the main big paging file that you use on the host operating system.

9:00This is a smart paging file that is temporarily created in low memory situations in order to get it back up to this 2048 if necessary to perform the full restart. And then while the operating system is running, if we have something that's extremely high demanding or whatever, we could increase up to and that should be-- Is that a terabyte? Yeah, a terabyte of memory there. And, of course, I've only got 64 gigs of physical RAM on this physical machine, so it would never be able to get quite that high. But at least in theory, it could go up to a terabyte if I had a terabyte's worth of RAM installed.

9:34And then we also have this value here, the memory buffer, and that works in coordination with the current needs of the installed operating system and what its current memory requirements are. So, it'll take what those needs are and it uses a factor to add in a 20% buffer to give it better performance. Then there's this value down here, the memory weight. This is a relative value. So, for example, if all of my machines were all smack dab in the middle here, then they would all be equally distributed, especially in a low memory situation. But if memory starts to get oversubscribed, then anything that's up higher-- so, for example, if this machine is a couple of notches higher and all the other machines are right in the middle, then this one will start to have priority in terms of allocating memory.

10:16And if you want a little bit more detail about how much memory is available in your normal runtime environments, you can use Performance Monitor there just as an FYI. There's a counter there, the Hyper-V dynamic memory balancer, and specifically what you would look for here is this one, available memory for balancing. Now, of course, I don't have much going on on mine, so I highlighted it. It's the black line you can see way up here at the top. So, it's got pretty much 100% of the available memory available for my virtual machines if needed. And then also, it's a little bit beyond our scope here, but there's also this item right here.

10:49It's an article from Microsoft that you can refer to if you like. And this is for virtual machine sizing guidelines. And because sometimes it's a little bit relative in terms of determining how big of a server should you buy that's for your Hyper-V server. How many hosts can it support? If you're using VDI, you're going to have to look for other data there as well. But this is at least a good starting point to determine what kind of load you can put onto your Hyper-V server. All right, that's it for memory. I hope this has been informative for you, and I'd like to thank you for viewing.

Configure Integration Services

0:00[AUDIO LOGO] In previous Nuggets, for various reasons, we've kind of talked about the integration services, at least a little bit. But now, let's take a look at it at a little bit more detail and also about some of the specific ones we haven't covered yet. And also, we're going to be taking a look here at how to manage these using PowerShell. So here we are in the Hyper-V host. And in order to access these Hyper-V integration services, all you really have to do is to right-click a machine like I've got this domain controller down at the bottom here of my list, and if I go into the Settings-- it's very simple, it's right down here where it says Integration Services, obviously.

0:38And then, by default, at least in the installations I normally do, all of these top ones right up to here are selected by default. Why they don't do the bottom one, I don't know. But let's talk a little bit about what these are. And by the way, each one of these has a corresponding guest side to this inside of the virtual machine. When you install a virtual machine that's a Windows virtual machine, it just somehow knows that it's a Hyper-V guest and it'll install a corresponding service for each one of these items and run it.

1:11Well, here we have the first one, Operating system shutdown. OK, when we do that one, what's that really talking about? I mean, would we not be able to shut down the virtual machine if that did not exist? No, certainly you can. In the UI, if you're in the UI of the desktop for this machine for example, like I am right here, obviously, you can still click the Start menu and hit the little power button and all that. Or you could just run shutdown space forward slash s space forward slash T followed by a time interval, which is how I do it usually from the command line.

1:41But what we're talking about here is the capability of going to the virtual machine here in the host, right-clicking on it and then choosing Shut Down. See, without that item there, I would only have either Save or Turn Off as my other options. And Turn Off has an undesirable effect, the same as flipping the switch, the power switch on a physical computer. You do that and you could wind up with corrupt files, things that are kind of half open, so to speak, corrupt operating system. Really pretty nasty.

2:12As you know, you don't ever want to shut down a machine like that if you can. The other integration service that we have here, if we go back into these would be this Time synchronization one. This one is pretty important because as I've mentioned a couple of times in this course, time sync is so critical to Windows machines because of Kerberos. You see if Kerberos tickets are any more than five minutes out of sync or a log on attempt for example, any more than five minutes out of sync with its authenticator, then it's going to not work. It just fails authentication.

2:42So you have to have time synchronization. Now if I did not have that turned on, what would happen on my guest? Well, at least initially, it would still have the same time as my host operating system. Now you really want the chain of time to be consistent all the way through. So on most Windows operating systems, by default really, it synchronizes with a reliable time source, usually a time.windows.com, I think it is something like that, time.microsoft.com. And you can look at it in your settings and find it if you want. But that's an atomic clock which is accurate to within, I don't know, a bazillionth of a second or something like that, OK.

3:17So very, very accurate time, in other words. If you're in a domain, then your client will synchronize up with your domain controller, which then-- especially if it's at the top level of your infrastructure, would then get its time from another authentic time source, such as Microsoft or NIST or some government organization like that or atomic clock, something like this. Anyway, the same would be true of a guest here. So why do I have to have this time sync? Well, what can we do here that we don't do in physical computer land really so much?

3:49We can right-click here and choose Save. That's a little bit different than what you could do on a desktop. If I choose Save and I had that time service turned off-- Let's say, I turned it off for 12 hours. When I resumed it again, then the time would be 12 hours off and it wouldn't sync up with my host operating system. I would have to then make sure that I had also enabled some other synchronization mechanism with that client in order to make sure that it had current time. Otherwise, it just causes a whole mess, so don't mess with that one. And then what else we got?

4:19We have Data Exchange. OK, Data Exchange is not something you use very often, at least consciously, so to speak. It really refers to a registry value in the guest operating system where you can use it to exchange various types of small amounts of data like metadata. You're not doing this for file transfers or something like that, Word documents or something. You're doing just small bits of data. It might be of value that evaluates to yes or no, true or false, something like that. And it's just going to be string values.

4:50And in fact, I thought I'd just go ahead and take you to the registry location where that actually is. If you look at the top here, you can see that I'm in-- well, I guess I cut it off, let me try it again. If you look at the top here, you can see that I'm in Computer HKEY_LOCAL_MACHINE_SOFTWARE Microsoft Virtual Machine. And then from there, we go down here into these values, Auto and then this is just any data that's going to be exchanged between the host and the guest. So this might be useful in identifying certain aspects of it, such as the operating system version, build number, stuff like that.

5:21But the other part of this would be external, which would be any kind of metadata that I would exchange between the host and the guest. This would be coming from the host operating system into the guest. And this would be any data that I have from the guest that I'm going to send out to the host. And you may also see this referred to as a KVP, which is key-value pair. And then returning back here, the next thing we have would be the Heartbeat. This is what tells the host machine whether or not the operating system is actually booted and running in the guest.

5:54But it's also a little bit misleading when I describe that, so let me clarify. You see where it says Running right here, you can see I've got a couple of different machines that are running right now. Running doesn't really mean much. There might not even be an operating system installed there. It might just be a Bare Metal kind of thing or something like this. So that does not necessarily mean that the operating system is booted and healthy. Although we don't see it in any of the UI things right through here, this is that value that I showed you there, the Heartbeat, is what communicates to the host that the operating system has booted and is healthy.

6:24And then there's a Backup. This one's interesting, the volume shadow copy service. OK, so in order to understand that, you kind of have to understand how backup works in its older and most fundamental sense. If I have-- let's just think about a file backup. If I want to backup my documents or whatever, then if I have a Word document open right now and I try to back it up with older methods, it would skip that file, because it would say the file was open at the time the backup tried to run. Well, with modern Windows-- this has been going on for a few years now, it uses the volume shadow copy service and it kind of creates a sly copy of that file even though it's open, and then it backs up that copy.

7:02I'm oversimplifying a little bit. But by doing so, it's able to actually back up a file even if it's alive and open. And this overcame a significant problem with backup solutions in years past. Because some files are open almost all the time, and therefore, would never get backed up. And by the way, if they're open almost all the time, probably means they're pretty important. So here, the volume shadow copy service can also interoperate with virtual machines so that you can even back up your virtual machines when they're running. And then finally, I think I demonstrated this in a previous Nugget, there's this Guest services.

7:36That's what gives us the ability to copy files back and forth. Now as an FYI, inside of your guest, each one of those services that I just talked about, those integration services, is also visible here. If you go into Services such as in Computer Management where I am now, or you can just go to the Services node, and there should be a Hyper-V set of services. Each one that starts with Hyper-V corresponds to an appropriately named guest integration service that we just looked at. And I don't think any of those are a mystery. So if you just look at those, that happens to be the very services that control all those things.

8:10They should all be running. If you've selected every box, they should all be running except for this one, because this one is the PowerShell direct service. That's what we talked about in a previous Nugget here as well. Might have been in the previous skill in fact. But the PowerShell direct service, that's only going to be running when we're actually using it, when we're actually sending commandlets. Now I can't really think of a reason to stop any of these services particularly unless it has to do with some kind of a troubleshooting thing. But Microsoft has also document it, so I wanted to go ahead and share with you how you would stop those services.

8:42By the way, what I'm about to show you there would be true of really any service, this service or that service or any other service you wanted it to work with. And again, for this I have this PS1 file integrationservices.PS1 available for you as a student download as well. Anyway, what we will do here is, first of all, you got to know the name of the service, because sometimes they're a little obscurely named or you just kind of have to guess. So I'm going to go ahead and list the services first by get service, and anything that starts with VM, I do know that much. And so any of those that start with VM will now appear, and we see them down here at the bottom.

9:15Now, as you could see, in this case, I ran those from my host operating system. So all of those services that we just discussed are stopped. So therefore, that's not really what we're looking for. What I would want to do is to run that inside of the guest itself. So let me copy that, hit the little Copy button, then I'll head over to the guest where I am right now, I'll right-click on a Windows PowerShell as I start to type that in the search bar, and then I'll run that as administrator, because that obviously would have to be run as an administrator. Then I'll paste that in Get-Service -Name vm, and there we go.

9:46You see that those services are now here running except for the PowerShell direct, which we already discussed. And then of course, if we wanted to stop one of those-- Let's take this vmicshutdown, OK, this is the shutdown one. Then I can enter that here as well like this, Stop-Service -Name, and then vmicshutdown. And then that would then, of course, shut down that service. We should be able to confirm that if we go into the background here. There's the shutdown service. It says it's running. But if I refresh it, I'm pretty sure-- yeah, there it goes, it is now stopped.

10:16And then of course correspondingly, if I wanted to start it, I would go back here and just type Start-Service and press Enter. And we should see that also in the background here as I refresh the screen then come back up and running again. Now I mentioned earlier that Heartbeat service, that's what tells us whether the operating system has booted and is running properly, which is not to be confused with that running status thing that you'll see in the host operating system. But if you do want to see from a command line if it's running properly, you can run this here as well. This actually might be useful, because you could, if you have a cluster of virtual machine servers or if you have some VDI machines that you want to see if they're running properly, then you could script that and then what we would do here is just run that line.

11:00Let me use the little squeegee here to clear off the previous screen. But I can just run that line there and it gives you information about whether the operating system is up and running normally. And also here, I went to my Windows 11 computer, and I saved that machine. Let's see what happens if I run that same command again here. I think that machine's Win11-01. Hopefully, I remember the name right, and press Enter there. And it says Saved but Operating normally. Oh also, as you can probably imagine, all of these, computer names and everything, just change those to whatever your computer names are in your lab environment.

11:31If I wanted to look at the status of the integration services from the host side of things, then I would run this line right here. Let me squeegee all of this away. And then run that little item, and then we can see again here whether they are enabled. And it looks like they're all OK. And then these are pretty simple down here at the bottom. I think you could probably make sense of those. I'll just run those real quickly. I could disable one of those services, like the Time Synchronization service. With those, you don't actually type the name of a service, you type in the way it appears in the plain English version over here.

12:02So you see that it says Time Synchronization-- for some reason, my highlight's not working-- there it goes. Time Synchronization right here. So I just type in the actual name of it. And that's how I'll run that one, so let's run that and we can see that it would then disable it. If I want to run that previous line again, we'll confirm that. Yeah, sure enough, it is not enabled because I just disabled it. And then if I wanted to re-enable it, I would just do pretty much the same thing only to choose Enabled instead now. And then we should now see that it has now become, once again, enabled. And it looks like it is.

12:32OK, and then just as a final note here, I'm going to point you to a document here. And you can see the URL up here at the top. It's kind of long. But if you also just search for Manage Hyper-V integration services, I think that'll get you here. But the reason why I'm here is because I've shown you some of the things that are already in this, but we did not really talk about Linux guests. And I don't know that you're going to really be tested on Linux products in a Microsoft exam, so if you're a test taker, might not be as relevant. But if you do run Linux machines, and you need to know some of this stuff for the real world, there you go.

13:03And it's about halfway down, you can see the kind of contents over on the right. It'll take you right here and good information. So there's your integration services in Hyper-V. I hope this has been informative for you and I'd like to thank you for viewing.

Configure Discrete Device Assignment

0:06Discrete Device Assignment, while this is an interesting concept, typically what happens when you install an operating system on hardware, for example, is that in-between the operating system and the hardware, you have to have the drivers, because the drivers are what allows the operating system to control that hardware. However, when you're taking a look at something called a Discrete Device Assignment in virtualization, you have a different situation going on. So here at the bottom level, we have the hardware, and then we have drivers right here in-between the actual hardware and the host operating system.

0:42Now when we bring virtualization into the picture, which in a certain way is really an application on top of the operating system, then what happens here is we have another layer of drivers. And of course, I'm probably oversimplifying somewhere in here. And then on top of that, in your virtualization here, you would have the various operating systems-- Windows, Linux, what have you. So what happens here is maybe I've got a very high end video card down here that I really want to take advantage of. And I want to be able to take a look at, oh, all the fancy stuff that video cards can do now, the shading, the processing, all that sort of thing.

1:18But because I'm just using these middle drivers right here that are part of, in this case, Hyper-V application, they're probably not going to be able to deliver all of those whiz bang features that the actual manufacturers drivers could. In addition, if you think about something like video cards, well, of course, they're frequently used now for mining, Bitcoin mining, Ethereum, other kinds of mining that can take place. And so if I had some virtual machines up here that were mining, maybe I would really rather have these drivers directly connected to those virtual machines.

1:51And really it wouldn't even be that way, it would really be the drivers, the original manufacturers drivers themselves would be installed on the virtual machine and would give me direct access to this video card, then I could get the full benefit of it, and there's really nothing in between and very little, if any performance hit by doing it this way. Whereas here we kind of dilute the whole thing. Looking at another example here, what if I had something called NVMe, that's supposed to be a little e, but I can't seem to make it that way, NVMe. I'm going to show you something about that here coming up.

2:22But that's really storage related, and it's designed for SSDs. But it's a way of magnifying the performance and throughput of these types of storage devices. Now if they're just directly connected through the drivers to the operating system, and I have virtualization in the picture at all, then I've got all the performance I need there just locally. But once again, if I have a virtual machine up here that needs to take place of that super high speed performance, then I need to figure out a way to get drivers here that directly connect to that hardware and bypassing in a certain way the middle drivers that we see here.

2:56Well, that's what Discrete Device Assignment is all about. Let's take a look at what goes on with this. This is actually what's going to give us direct access from the virtual machine to that physical hardware through to that fantastic artwork that I showed you just a moment ago. I should put an NFT up on all of that drawing that I did just there. I'll probably make a million dollars. What we can do here is we can bypass those middle host drivers from virtualization as I just described. And the two things that I described there, which are really relevant here is that so far, Microsoft and Hyper-V are supporting initially, at least, graphics adapters and NVMe storage.

3:33Now there are other devices that will work. In fact, I have on my own computer other devices that could work, but they're not supported so to speak, and you have to check through each one and test it to make sure it'll work. Obviously, the benefit here is going to be dramatically higher in performance, and it's really intended for server class hardware. So I'm really recording, for example, I'm more of a workstation level, although it's a pretty powerful workstation. It's a machine that CBT Nuggets sent me a while back. It's got great graphics cards, and lots of memory, and storage, and SSDs, and all that, but it's not really a server.

4:07But it would make a great gaming server if I were to play games on a work computer. Of course, I would do that. OK, now what are the requirements to make all of this work? First of all, the virtual machines could be either Gen 1 or Gen 2. You don't have to go, oh, I need to have Gen 2. No, either one works. And it works with the modern operating systems of Windows 10 or greater for the desktops and Windows Server 2012 R2 or greater for a server operating system. And you have to have hardware that can grant the operating system control over the PCIe fabric.

4:39So really what that's doing is it's getting directly down into. It's a direct connection into that hardware, and you have to enable that in your BIOS. You'll look for a setting there. Sometimes it's buried two or three levels deep. You'll probably have to get into the advanced settings. I did that on my own computer that I'm recording from here. A little further into the menu system there, but you would enable SR-IOV, is the setting that you want to enable. And then I'm going to show this to you. There is a Microsoft script that one of the developers at Microsoft wrote that will test your compatibility to see if it works at all.

5:13And if it does work, which devices will work with this Discrete Device Assignment? All right, and so what is this NVMe? First of all, that's the storage that I was talking about. Here I've gone to Kingston's website here. And you can see where I'm in right here. You can go there as well if you like to. And I recommend that because of all the places I've gone, they have an excellent run through on what NVMe is, which is really-- I don't think I've explained the acronym. It's Non-Volatile Memory Express.

5:43I think it is. I think it's down in here. Yeah, there it is. Non-Volatile Memory Express, is what the acronym is. So I definitely recommend that you read through this. It's an excellent article, and I would definitely give it a read through. Oh, it looks like she's looking right down to the top of my head, it's probably what the glare is on top of her glasses there. The shiny head of baldness. OK, so when you take a look at this, though, this is a key statement right here compared to SATA equivalents. It will transfer 25 times more data.

6:15And that's just the start. There's other things that can make this even faster. It just gives it a higher level of throughput. You can see all other things that they have down here. I'll get into more detail on that. But if you want to know more about NVMe, this is a great read. And then switching over here, this is Microsoft's article on deploying these types of devices, if I can stop this here. They can read it, it's docs.microsoft.com, and you see all the rest or you can just google for the title, probably be a better idea. Anyway, this gives you the specific details on how to make these connections from your host.

6:45I don't have any devices that are compatible with this. And then for video graphics devices, then this is shown right here also from Microsoft right here. And again, you can also google for the title. But this gives you also the specific directions in PowerShell commandlets and things that you'll need to enter in. And then finally, I'm going to this article right here. I'm referencing this elsewhere as well. It's long, but it's in a script that I'm going to provide for you. So I'll show you how that works here in just a moment. This is the one that a Microsoft engineer developed presumably.

7:16It's this Ryan Morash guy who did this. And thank you, Ryan, if you're out there. Thank you for writing this because this is a really good script. Let me show you how this works out. So I just put this in PowerShell ISC and I referenced-- and this is available for you on Nugget lab in our student download files. I reference the URL there if you want to go there directly yourself, and that's probably a good idea as well because this might get updated. But anyway, if you want to see what devices locally are going to work for you in discrete device assignment, this script will identify them for you.

7:48Now, this will not work initially. So for example, if I hit the big green Play button right up here, it says, oops, it won't run. It didn't really say it in a word, but it says right down here, cannot be loaded because running scripts is disabled. So it's restricted. That's the setting that I have. So if I want to find out why that didn't run in terms of scripts anyway, I could go to good execution policy and hit the little green button over here to the right or hit F8, and that says, yep, sure enough. That's why because it's restricted as you can see right down here at the bottom.

8:19Now, what's that about? Well, normally, you don't want your operating system to run scripts just unrestricted, because malware could infect your computer, and a script is completely powerful. It can completely overwhelm and take full control over your machine, or to do something discrete and slide, and maybe plant some kind of malware that you're not aware exists. Lots of different kinds of things. So what you could do is you could run this unrestricted. And if you do that like I'm going to do right here, I would only do that temporarily.

8:50Don't just do that and then forget about it. Just make an unrestricted, run the script you want, and then turn it back on to restricted, which is what I've got down here. The other option there, there's another one that's all signed. You can also do all sign, and that would only allow scripts to run that are signed with a respected signature. OK, so I'm going to make this unrestricted, and I can just do this to all. But it's really only one thing anyway. So I'm going to do that one and then I'll do another get execution policy. Now I can see that it is indeed unrestricted.

9:20And then I'm going to run this script from the Microsoft person that wrote this, and we'll see what kinds of things will work on my computer if I wanted to use them. Now, I've run this in advance so I can tell you in advance. I can't actually use anything that's here, but it does show some things that at least have the capability of running. This USB Type C port policy controller, that one would work. And by the way, you do have to know the location of that. This will also be mirrored in Device Manager if you look at that. But what you have to have there is MMIO gap space, not all devices require it, but some do.

9:55And by the way, MMIO is Memory-Mapped I/O. OK, so anyway, yeah, so I could do that. But if I use this USB controller to demonstrate that, then it will disconnect my camera, and my mouse, and keyboard. So that can't be done. Likewise, if I scroll down here, this one disables the tablet that I use to draw on and everything like that. So I can't use the ones that we see down here. But you'll see what it looks like, at least if you have devices that are compatible. And again, it's designed mostly for server-level hardware.

10:26And then before we conclude here, I should point out some limitations here with virtual machines using Discrete Device Assignment. First of all, you cannot use Save or Restore. So you know how you can right click on a virtual machine and save it? That same kind of an idea there. You don't have that capability. Of course, since you can't save it, you also can't restore it. Also, there are no live migrations in order to move a virtual machine to a different host, for example. You do not have the capability of using dynamic memory. So you're going to have to be sure you carve out enough memory in advance.

10:57And you cannot put one of these virtual machines in a high availability cluster. But there you have it. That's using Discrete Device Assignment in a virtual machine allows direct access to those hardware devices for very high performance. I hope this has been informative for you, and I'd like to thank you for viewing.

Configure VM Resource Groups

0:00[MUSIC PLAYING] Hey. Let's take a quick poll here. How many of prefer more work? Raise your hand. Yeah, not too many of you, a couple of you over there. I'm not sure what's the matter with you guys. Anyway, how many of you prefer less work? Yeah, just about everybody raised their hand when I asked how many of you preferred less work. Well, if you preferred less work, then VM Resource Groups is for you.

0:33You see, when it comes to virtualization-- and we've been playing around with a couple of machines here and there, maybe a dozen or so. How many have I got? Not too many, but I've got some that Microsoft configured here from various labs and things, and I've got a couple I created on my own. This is manageable in human terms. It's not that big a deal, but when you're in a production environment where you've got a lot going on, bunch of web servers, you've got a bunch of remote desktop computers that you're running in here, all that sort of thing, it could get to be hundreds of machines, difficult to manage after a certain point.

1:06Even if you use good management techniques and good naming conventions to find the machines that you want to work with, it still gets to be a little bit of a hassle. So, Virtual Machine Resource Groups will allow you to take repetitive actions, repeatable tasks, and you can perform them against a group of virtual machines all at once. Some servering suggestions for this, some types of servers that you might want to work with or machines would be a remote desktop farm. That's what I'm going to illustrate when we look at demos in a moment, domain controllers, web servers.

1:39And, again, that's a really good candidate for maybe dozens of servers, or hundreds even sometimes, that all have supposedly the same content, the same configuration, all that sort of stuff. So, I want to create repeatable tasks against all of my web servers, for example, so that I don't have a maverick out there that's got some kind of a configuration on it that the rest of them don't have, and then we get a consistency problem-- it's a hassle-- or a Hyper-V replica. We don't really talk about that here, I don't think, in this particular course.

2:10But that's where I have a virtual machine on a specific host and we can replicate it to another host. Now, the key to the management here though, is that there's no UI for it. You only use PowerShell with this thing. So here I'm going to embark on using PowerShell to show you some serving samples of how this might work out. Of course, PowerShell is very flexible, a lot of different ways you can work with it. So you don't have to do everything the way I'm doing it. These are just serving suggestions. So one of the ways you might do it is, if I've got a bunch of machines that I'm going to be working with and if they're difficult to type or the names are long or convoluted or something like that-- and that does get to be the case when you have lots of machines and you have to make them all unique-- I might want to shorten some of that up and make variables there.

2:56The other advantage of making the variables is if I have a repeatable action or a script that has to reference the same computer over and over and over again, then I don't have to keep typing it in there. I can just use the variables instead. And in this case, all those variables are going to be put into a group anyway. This script, by the way, is available for you up on nuggetlab.com. I'm really hesitant to call it a script. It's just a bunch of separate commandlets that we've got typed in here. And then what I'm going to do here is, I've created a VM group. But what we're going to do here is we can use these variables to add virtual machines to a group.

3:30We're going to then-- and there's the variables that we got right there. Actually, let me just run all those at once right now real quick. And for what we're doing, it's small enough that it really won't make much difference if I use variables or not. But you can see down at the bottom, it did the commandlets. Then I could create a virtual machine group or VM group. So, what I do with that is, this is the beginning of this. I create a new VM group, and then I name it. This is an arbitrary name. Call it whatever you want. I'm going to pretend as if this is a remote desktop farm, so I called it RD farm.

4:01And then the group type that I'm creating is a VM collection type. Now, there's also another kind, and I've described it down here. But there's another type of a group that you can create here called a management collection group type. And all that is, is it's a collection of groups. So, I might create several different VM groups of the VM collection types. And once I've got a few of those, I might want to manage them under a higher overarching management group, and that would be the management collection group type.

4:31So then let's see here. Let's go down and scroll down a little bit. Then I need to add the members to the group. Right now, the group is just empty. I haven't created it yet. Let's create it. So let me put my little cursor up here, and I'll create that group. And you can see here the members just have empty braces there. So in other words, there's no membership there right now. So what I need to do is to add members to that group. And I'll go add VM group member, and we'll hit that one. And then now we will see down here, as long as I don't see the red letters, I'm pretty encouraged.

5:02So, what I want to do here now is to confirm the membership also. Remember earlier when we saw the membership, it was just the braces, meaning there's nothing in there. Here we'll confirm the membership by doing a get VM group. So I'll run that one. And we can see that sure enough, in between the braces are all of the members of this group. Now, there's a lot of different kinds of things you can do with this. You could send a registry value to all of them simultaneously as a group. What else could you do? Send a file or send some files to them. You can also start up the computers all at once.

5:33Maybe I've got all these in a group for a new website we're ready to spin up, and once I'm ready to pull the trigger, I just start up that group and set up dozens or hundreds of web servers all at one time using a group. In this particular case, these are the four virtual machines that I've referenced there in the script so far, HYD client one, two, and three, and four. And as you look at the checkpoints now at the bottom, there's either none or there's, I think, a default one, an automatic one. Yeah. So there's really not much going on there in terms of checkpoints.

6:04I'm just going through all of them, and we see that it's really just mostly empty there. So now what I want to do is, I could in the UI here, because it's not too hard, I could just select all of those and hit checkpoint. But, again, in a larger environment where you've got a bunch of scattered machines, it's much more efficient to put them in a group and then manage just that group at once. So what I'm going to do is, to use PowerShell to hopefully make all of that a little bit more streamlined. All right. So we're going to, first of all, create a checkpoint. It's going to be checkpoint hyphen RM.

6:35That's the commandlet. VM, we're going to specify which VMs. If I didn't have this group, then I would just name the virtual machine. But instead, since I have the group, I'm going to put it in the parentheses here. Oops. I'm clicking and dragging. You don't want to do that. I'm going to get the group of RD farm and its members, and I'm going to name the snapshot. Let's say before new app. Maybe I was ready to deploy an app. We already tested, of course, because that's what we do as administrators. We're not reckless. But anyway, just in case it causes some unexpected bad behavior, we're going to create a snapshot called before new app.

7:11So now I'm going to go ahead and run that. I think there's going to be a progress bar-- yeah, there it is-- that you can see here it's creating these checkpoints for me. And wow! Lickety split, it just creates all those checkpoints. Geez, who says lickety split anymore? How old am I? Anyway, so let's go back to these virtual machines now, and now you can see, sure enough, if I go back up here, there's the before new app checkpoint. There's this one, before new app, before new app, before new app. You can see they all have this before new app checkpoint that has now been created.

7:42And then now let's imagine that, sure enough, that app, it crashed and burned on us, caused a big catastrophe. We're all up at 3:00 in the morning trying to figure this thing out, and we said, oh heck with it. Let's just go back to before the new app. So, we're going to now restore the virtual machine checkpoint, and we hit the run selection there. It's going to then restore them. I could force it, but I'm just going to say yes to all now, since the UI popped up there anyway. And then now they should all reappear. And then if I had actually made a change, then it would go back to that previous snapshot.

8:15Now, what else I could do, is maybe I'm trying to save some space, and we've got a really old crusty checkpoint that's taking up a lot of space. We're 100% confident, I hope, that we're never going to need it anymore. And maybe it's this before new app item. It's no longer relevant. So, now what I'll do is, I'll run that particular line. And we see that it is now deleting it all, and it's mostly the same lingo. It's restoring. It's removing. And then as I go back over to my virtual machines, HYD client one, two, three, don't see the checkpoint there anymore.

8:46Yep, sure enough, that's gone from all of those. By the way, while I'm here, let me remind you again that there's no UI management for the VM resource groups, so there's no way to tell just by looking, oh yeah, these four, they're in a specific group that I created. Not going to be able to tell it by looking at that. You're going to have to, again, depend upon PowerShell in order to also know what the memberships are. But anyway, now let's say that I don't need that group anymore, and we're decommissioning everything or something. Then I can delete that group, but you have to remove the membership first. You can't delete the group and it automatically remove all the memberships.

9:18By the way, it doesn't delete the virtual machines. It just deletes the membership, thankfully, because that could be catastrophic if you didn't understand that. So, anyway, I'm going to remove the group members. And you can see, again, the language right through here. I think that will explain itself. And then I'll hit the button right there, and it's now removed those members. If you want to confirm though, let's go back up to the get membership, get the VM group. And we can see that it now goes back to just the braces there. So, there's no membership at all there. And then if I want to remove the group, pretty simple.

9:50I can just remove the group like this. And I'm using force here, just so it doesn't prompt me with the yes/no. But it doesn't really matter too much for our purposes. I'm just showing you how you could use it. So, now I've run that, and now that deletes that resource group. So, there you go. That's how you can create less work for yourself by using these VM resource groups. Don't tell your boss about it. Tell them you're working 80 hours a week still. But hopefully you'll save some time there and get it down to 75 hours a week. All right, I hope this has been informative for you, and I'd like to thank you for viewing.

Frequently asked questions

What does the Hyper-V memory, integration services, Discrete Device Assignment, and resource groups lesson cover?

In this 49-minute lesson, the team member configures VM memory, Hyper-V integration services, Discrete Device Assignment, and VM resource groups. It is one skill inside the Administering Windows Server Hybrid Core Infrastructure (AZ-800) course, so Team Leads can assign it to admins who own Hyper-V hosts.

Which Hyper-V integration services are explained, and how are they managed?

The lesson walks through integration services in a VM's Settings, including time synchronization, Data Exchange for passing small amounts of metadata through a guest registry value, Heartbeat to confirm the guest OS has booted and is healthy, and the volume shadow copy backup service. The trainer also shows how to manage these services with PowerShell.

What are the requirements for Hyper-V Discrete Device Assignment?

Per the lesson, DDA works with both Gen 1 and Gen 2 virtual machines, with Windows 10 or later on desktops and Windows Server 2012 R2 or later on servers. Microsoft initially supports graphics adapters and NVMe storage, the feature is intended for server-class hardware, and other devices must be tested individually because they are not officially supported.

How does Hyper-V dynamic memory prioritize VMs when memory is oversubscribed?

The lesson explains that when memory becomes oversubscribed, a VM with a higher memory weight gets priority for allocation over VMs set in the middle. It also shows how to watch the Hyper-V dynamic memory balancer counter, available memory for balancing, in Performance Monitor, and discusses how VDI workloads affect memory use.

Why would an IT team use VM resource groups in Hyper-V?

Resource groups let administrators run repeatable tasks against sets of similar servers, such as dozens or hundreds of web servers or domain controllers, so no single server drifts out of configuration. In the demo, the trainer creates a checkpoint named before new app across every VM in a group at once before deploying an application.

How does this lesson fit into AZ-800 preparation for an IT team?

This lesson is one of 37 skills in a course of about 39 hours that prepares teams for exam AZ-800 and the Windows Server Hybrid Administrator Associate certification. The course is designed for administrators with 2 to 3 years of Windows Server experience, and its virtualization block is best taken in order alongside the identity, networking, and storage blocks.

What's next?

Ready to keep going?

For your team

Bring this training to your team

See how CBT Nuggets helps IT teams close skills gaps, hit compliance targets, and prove training ROI.

Book a Demo
Just need Hyper-V?

Learning on your own? Browse individual plans ($49/month, billed annually) →

Not ready to buy?
with no purchase required. Already have an account?
Book a Demo