Hyper-V Deep Dive 8: Improvements in Migration

One thing virtualization admins can't do without: VM migration. We look at improvements that Microsoft has made in this area to conclude our series.

More on this topic:

We've looked at quite a bit in this series on the new stuff in Hyper-V and now it comes to this: VM mobility. Let's close out our look at Live Migration, Shared Nothing Live Migration and Live Storage Migration.

If virtualization administrators had to pick one feature that they couldn't do without, I'm sure the majority would pick VM mobility. Being able to move VMs without perceived downtime for end users gives IT flexibility for maintenance, patching and High Availability.

The original version of Hyper-V only offered Quick Migration, which pauses the VM briefly during the switchover from host to host. It's still available for times when uptime isn't critical and in most cases a Quick Migration is faster than a Live Migration. Hyper-V in Windows Server 2008 R2 added Live Migration but only allowed a single LM between two hosts in a cluster. As the maximum number of hosts in a 2008 R2 cluster is 16, this allowed for a total of eight simultaneous LMs. While it would serialize multiple LMs from one host, doing one after the other, this can be a limitation in large environments.

All VM move operations in Hyper-V are handled by the same wizard; you simply pick the type you want.

Figure 1. All VM move operations in Hyper-V are handled by the same wizard; you simply pick the type you want. (Click image to view larger version.)

Windows Server 2012 allows as many simultaneous LMs as you want, with a setting per host where you can decide how many that you want to allow. The limitation on simultaneous LMs really comes down to your hardware: Is your LM network connection 1 Gbps or 10 Gbps (or teams made up of several NICs), how large (in terms of assigned memory) is each VM, and what's the rate of change to the memory content in each VM during the period of your LM? Based on these parameters you decide in your network how many LMs to allow on each host. In a cluster, when a host fails, running VMs on that node are restarted on other hosts. When the original host is up and running again VMs will automatically fail back -- in 2008 R2, this was a Quick Migration; in 2012, it's a LM.

LM on a Hyper-V host is disabled by default, so you have to explicitly allow incoming and outgoing LMs to a host. Also the default setting is to use all available networks for LM traffic -- this, of course, should only be used in a test lab. In production, a specific network should be used for LM.

You need to enable incoming and outgoing Live Migrations on a (non-clustered) host before VMs can be moved around.

Figure 2. You need to enable incoming and outgoing Live Migrations on a (non-clustered) host before VMs can be moved around. (Click image to view larger version.)

Also new in Windows Server 2012 is the ability to store virtual hard disks of VMs on a SMB 3.0 file share (as covered in part 7) and the ability to LM a running VM between non-clustered hosts. This opens up a lot more flexibility in datacenter design, as lower priority VMs without HA demands can be stored on simple file shares but still be moved between hosts to allow for maintenance.

For all LMs taht you need to give the user as well as the computers in each end permission to perform LMs, be aware that when you go into the trusty account picker to add the computer accounts these won't show up. By default only user, groups and security principals are shown. Simply add computer accounts to the objects the account picker looks for and you should have no trouble. If you have more than a few computer accounts to add it is easier to create a group for LM and add all Hyper-V host computer accounts to it.

Make sure you remember to add Computer Accounts to the list of object types you look for.

Figure 3. Make sure you remember to add Computer Accounts to the list of object types you look for. (Click image to view larger version.)

Live Storage Migration
Windows Server 2012 also allows you to move the virtual hard disks of a running VM with no downtime for end users through Live Storage Migration (LSM). The CIO version of why this feature matters is "because sooner or later you'll replace a SAN and with this feature you can move all VMs to the new one without downtime." For us in the trenches, the main reason for this feature is being able to move a VM from a disk that's run out of space (generally because of using Dynamic disks) to one with sufficient storage, hopefully without anyone noticing.

Because of LSM, a cluster is no longer the boundary of VM mobility. Therefore, a VM can be taken out of a cluster (being non-HA for the time it takes to migrate it) and LSM to another cluster and then added as a HA role in the new cluster -- this happens all without VM downtime. SCVMM 2012 SP1 will do this with one wizard, but with Hyper-V Manager or PowerShell it's a multistep process.

You can move the whole VM or only move the storage, including selecting individual VHD(X) files to be moved to different locations..

Figure 4. You can move the whole VM or only move the storage, including selecting individual VHD(X) files to be moved to different locations. (Click image to view larger version.)

An LSM is technically quite interesting. After the initial session is established, the data from each VHD(X) file is replicated to the destination storage while also tracking write changes to the disk. This eventually achieves a storage mirror where writes take place on both hosts, and this is followed by a normal LM to actually move the VM to the destination host.

Shared Nothing Live Migration
In an industry first, Windows Server 2012 offers migrating running VMs between two hosts that share nothing except a network connection. It might seem like a feature with limited use in production, but consider the many scenarios it enables, including the migration of VMs between clusters as I described above.

A gotcha with non-clustered LMs is if you use Remote Desktop to remote into host1, start a LM of a VM to host2, which successfully completes and then you want to move the VM back to host1. Unless you Remote Desktop into the host2 and start the LM from there, you're likely to get an error message. This is because of how Windows security and credentials work, specifically by not allowing one server to pass your credentials to another server. The solution is either to enable constrained delegation the traditional way, which requires Domain Administrator credentials to set up. The alternative is to use resource-based, Kerberos-constrained delegation, which doesn't require Domain Admin privileges and also works across domain and forest trusts. You can also use PowerShell Remoting with CredSSP or SCVMM 2012 SP1 with correctly configured Run As accounts to manage security for non-clustered hosts.

Other Improvements
You can now merge a snapshot while the VM is running and this also actually deletes the snapshot files. Another huge improvement is in the area of exporting and importing VMs, in earlier versions this worked fine as long as the server you were importing to had very similar configuration, if not the VM tended to "lose" parts of its configuration along the way. The new import wizard inspects the configuration and will ask about configuration items that don't match and so let you wire the VM up to work on the new host. Even better is that you don't actually have to use the export function any longer, as long as you have the VHD(X) files and the configuration files you can simply import a VM on a host.

This concludes the series of eight articles where we looked at the technical improvements in Hyper-V in Windows Server 2012. But we're not done just yet: Next time, I'll compare Hyper-V to VMware vSphere both technically and looking at each company's approach to virtualization and private cloud.

More on this topic:

 

About the Author

Paul Schnackenburg, MCSE, MCT, MCTS and MCITP, started in IT in the days of DOS and 286 computers. He runs IT consultancy Expert IT Solutions, which is focused on Windows, Hyper-V and Exchange Server solutions.

Reader Comments:

Add Your Comment:

Your Name:(optional)
Your Email:(optional)
Your Location:(optional)
Comment:
Please type the letters/numbers you see above
comments powered by Disqus

Virtualization Review

Sign up for our newsletter.

I agree to this site's Privacy Policy.