Join Ed Liberman for an in-depth discussion in this video Implementing live migration, part of Windows Server 2016: Configure Hyper-V.
- [Narrator] A virtual machine is always running on a Hyper-V host, but sometimes you may need to move the virtual machine from one host to another. It could be for maintenance reasons or maybe it's that you bought a new server to act as your host and you're going to decommission an old one. It could be storage related issues. There's a lot of reasons that you might want to move a virtual machine over to another host.
The trick of it is trying to figure out how you would do it without having to take the virtual machine offline. Right, 'cause your users are connected to it and are trying to use it. Well, this is where something called live migration comes into play. To demonstrate live migration I am on a Windows server 2016 computer here that has the Hyper V role installed. In the server manager let's go up to the tools menu and select Hyper-V Manager.
Here in the Hyper-V Manager I want to show you that we are connected to host one, that is the server that I'm currently connected to, but I should also mention that on my network here I have a second Hyper-V host that I've created. It's actually called host two. So, if I go up to the words Hyper-V Manager themselves and right click, I can select to connect to a server. And here I want to connect to host two.
And now you see I'm connected to host two. And if I click on it you'll see it says there are no virtual machines. I've done basically next to nothing with host two. I went ahead and installed the Hyper-V role and I did create a folder structure just like I did on host one, where I have a Hyper-V folder on the C drive and then another folder for the virtual hard disk. Now, in order to do live migration, we have to make sure that our Hyper-V settings allow for it.
So, I'm going to right click on host two here and go to the Hyper-V settings and I believe this one should already be set up. So, I'm going to click on live migrations and you'll see the box is already checked to allow it. This is because I did it during the installation of the Hyper-V role. If you watched the video on how to install the role you might remember that there was an option to do that so on host two I went ahead and I did that whereas, on host one, this is the one that we did in that video, and I chose to skip doing that.
So, you'll see that live migrations are not allowed here. So, let's check the box to go ahead and allow for live migrations. Click OK. And, if I go back to host one I'm going to take my demo VM and I'm going to right click and select move. Here I get the move virtual machine wizard. Before you begin overview screen that we always get, I'll click next.
I do want to tell you before we go any further there are some things that I don't expect to go perfectly here, and that's intentional because I want you to see some common mistakes and I also want you to see how certain things might need to be set up on a new host to make sure things are done correctly. So, I have a choice here between moving the virtual machine itself, and that is the live migration, or moving just the storage which I did in a different video on storage migration.
So, here we're going to take move the virtual machine. I'm going to click next. I need to give the name of the destination computer, so I'm going to put in host two. Next. And I can move all the data to a single location or I can move the virtual machine's data by selecting where to move items and this will allow you to select the location of each item you moved, or I can move the virtual machine only. So, I'm going to say that I want to pick where I want things to go.
'Cause remember, I want the virtual hard drives to go in a different place than the virtual machine itself. So I'll click next. And this is a neat feature that I like but you have to have the system set up properly in order for this to work. Moving the virtual machine's data automatically says, it'll move the virtual machine's items to the destination computer by reusing the same locations that are on the source computer. So, as long as you have the folder structure set up to match, then it will work. And I already told you that I did take the time to do that.
So, I'll click next. And, finish. And when I click finish, let's see what happens here. I'm expecting this is not going to go perfectly. Aha, see I was right. I got an error message here and look what it says. It says it could not find the internet switch called external internet. Now, the reason for that is because I didn't go into the virtual switch manager on host two. I told you I just installed the Hyper-V role and when I did it I only checked the box to say hey, take the existing network card and give me a connection.
So, there is something I can connect to. You'll see here it's just the generic virtual switch that it creates. So, I'll select that and I'll click next and I get the same error message again and I just don't want you to be fooled by this. It's not that it didn't work, it's that now it's finding the same error but for the check point that it's moving. So, again we'll pick the default name that it gave for the virtual switch and before I click next, I will tell you this could have been avoided if I would have went over to host two, went to its virtual switch manager and created a virtual switch specifically called external-internet.
So, I'm going to click next. And now I get a summary of everything I'm about to do and I'm going to click finish and drum roll please. It says that it's performing the move. Now, this may take a few moments and if you are following along then you know, it may take your machine longer or slower than mine. So, as you've heard me say on other videos on my end through the magic of video editing I will speed this up so that we don't have to stare at a bar for as long as this takes.
If you're following along, it's a great place where you could pause the video and then resume once yours has completed. Okay, so the migration has completed on my end and suddenly I have a blank screen here that says there are no virtual machines found on this server. What happened? Where'd it go? Well the reason I don't see anything is 'cause I'm still highlighted on host one. If I click on host two, hey look at that. I have a demo VM and it is running.
So we were able to actually move the virtual machine from one physical host to another computer altogether. Different physical host, all while the machine was running. Now, there is one other quick note that I do want to tell you about live migration and that is back in Windows server 2008 R2, that's when we first saw a live migration introduced.
But, you had to be part of a failover cluster in order to make this happen. So, I want to emphasize the fact that there is no clustering going on here because as of Windows server 2012 and again in Windows server 2016, they eliminated that requirement and all you need is networking capabilities between the two servers to make this happen. So, the next time you find yourself with a virtual machine on a host and you say boy, I really wish it wasn't here.
I wish I would have installed that on a different host, you can see that there's now a very quick and easy way to make that happen.
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