Search
StarWind is a hyperconverged (HCI) vendor with focus on Enterprise ROBO, SMB & Edge

Hyper-V live migrations: Which settings ensure the best performance?

  • November 28, 2018
  • 18 min read
IT and Virtualization Consultant. Dmitriy is specializing in Microsoft technologies, with a focus on storage, networking, and IT infrastructure architecture.
IT and Virtualization Consultant. Dmitriy is specializing in Microsoft technologies, with a focus on storage, networking, and IT infrastructure architecture.

INTRODUCTION

This post addresses Hyper-V live migration – the topic which any admin faces with at some point. In my salad days of working as an admin, Hyper-V live migration was a saving grace, so I decided to write an article about it.

Live migration is Hyper-V feature for moving non-disruptively a VM from one host to another. Users love this feature for flexibility and absence of downtime. You can easily migrate a VM from one host to another and it neither idles nor has to be shut down. On top of that, live migration, when paired with failover clustering, allows building highly available and fault-tolerant systems. Well, that’s why these technologies always come hand in hand.

In this article, I want to cover some live migration and migration wizard settings that ensure maximum performance of this process.

THE SETUP CONFIGURATION

Here is the configuration of the setup that I used to study how live migration works.

  • 1 x Intel(R) Xeon(R) CPU E5-2609 @ 2.40GHz;
  • 8GB (1 x 8 GB) RAM;
  • 1 x 200 GB HDD;
  • 1 x 1 Gb/s LAN;
  • OS: Microsoft Windows Server 2016

Below, find the list of VM guest OS:

1. Microsoft Windows 7 Professional SP1 Build 7601

2. Microsoft Windows 10 Enterprise N LTSC v1809 Build 17763.1, no UEFI

3. Microsoft Windows 10 Enterprise N LTSC v1809 Build 17763.1, with UEFI

Some real-life process on the VM was simulated with 7zip. I was archiving such folders: Program Files, Program Files (х86), ProgramData, and Windows. Why? Look, I wanted to imitate a real process on the VM and archiving seemed good enough for today’s study purpose.

To make a long story short, here’s how to configure Hyper-V live migration:

1. Set up the server for live migration and how many connections for simultaneous migrations are allowed.

2. Set up live migration protocols

3. Live migration. Select the type of the migration and what to do with VM items.

Now, let’s look at each step in more detail.

Phase 1 – Configuring the target host

First, you need to enable incoming and outgoing live migrations.

 Hyper-V Settings for WIN

You need to join the server to the domain; otherwise, the live migration won’t be available. You’ll just get an error, and nothing more than that.

9eba2a2f2734edbadc6d3b9eae7a2728

Hyper-V hosts can be either in one domain or in different domains, whatever. The thing is, they should be set as trusted hosts for each other. Here is an article on how to install and set up an AD controller for Hyper-V:

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc770946(v=ws.10).

Starting from Windows Server 2012, you can use carry out multiple migrations at the same time. By default, there are only 2 active connections between the hosts during live migration.

ef353e7507e69ca1db401b0e0abb76a0

Should you need to involve more connections in simultaneous live migrations, just adjust the number in that box.

Note that this number should be neither too big nor too small. On the one hand, using multiple connections for live migrations is a key to smarter utilization of network bandwidth. On the other hand, the more connections are involved in live migration, the more resources on both source and destination hosts are consumed. So, whatever number you set in that box, you should understand that by playing around with that parameter you may bottleneck your environment performance.

Next, you need to specify in the Incoming live migrations menu the IP you intend to use for live migrations.

9ecdb5c07b8cc7635b658746baabf68c

Otherwise, you can just leave the Use any available network for live migration option enabled.

ff6dc83b993b9f5fa9750f76ccac4ab5

Phase 2 – Setting authentication and live migration

Initially, go to the advanced features.

Hyper-V Settings

Next, set up the authentication settings in the Authentication protocol field.

9d9c94618271b22ee5fb8d18b08b3b6c

Here are some details about each protocol:

CredSSP (Credential Security Support Provider) enables applications to delegate users’ credentials from a client to a target server for remote authentication. Data is transmitted via an encrypted Transport Layer Security Protocol channel.

Kerberos is an authentication protocol providing a mechanism for mutual authentication between a client and server. Mutual authentication occurs between these entities before the connection is established. The problem is that this protocol assumes that transactions occur on an open network, a network where both clients and servers aren’t physically secure. In this way, packets can leak out or be modified. Note that you need to enable Kerberos constrained delegation before triggering live migration remotely.

Once you decide on the authentication protocol, go to Performance options to select the performance protocol for live migration.

2af0f6801f9318fcae9da4fff77e18b8

Now, let’s talk about each option in more detail.

1. TCP/IP allows VM memory migration to the destination server over a TCP/IP connection. Host opens the TCP port 6600 and transfers the data at the maximum available speed. Note that this option does not allow compression

2. With compression enabled, memory and virtual disks are compressed and are copied over TCP/IP. Note that compression consumes CPU resource but network bandwidth will never be a bottleneck. Speaking about CPU utilization, if your VMs consume all host CPU, migration won’t benefit from compression at all. Live migration with inline compression is available starting from Windows Server 2012 R2.

3. Also, you can carry out live migration via an SMB 3.0 connection. You can use either SMB Direct or SMB Multichannel for live migration. The former can be used when NICs on both target and destination servers support RDMA. This protocol allows offloading CPU, making the entire migration process not that resource consuming and faster. SMB Multichannel, in its turn, can be used when you set up the right multichannel configuration. SMB does not use compression, still it features RDMA.

Even if your NICs do not support RDMA, you still should enable SMB to ensure the maximum throughput. First, SMB features multipathing. This means that you always have all your NICs involved in live migration… even if you migrate only one VM. So, enabling SMB seems a good idea for multichannel migration.

If you use TCP/IP or enable compression, multiple simultaneous live migrations between two hosts will involve just one set of adapters due to algorithms of leveraging workloads. Taking all I wrote above, you should choose SMB over TCP/IP if the throughput is really high. You should choose compression over SMB if you have some extra CPU resource but you have limited network throughput.

Phase three – Live migration via the live migration wizard

Once you decide on the protocols, let’s, finally, live migrate a VM. Right-click on a VM, press Move.

Hyper-V manager - img

Live migration wizard enables to move either the VM or its storage alone.

738829715871e41c53e6138ae696184a

Once you choose any of those options, specify the name of the destination host.

Specify Destination Computer

Now, decide what you want to do with the VM items. Below, I write about each option in detail.

Choose Move Options

1. Move the virtual machine’s data to a single location. As the name implies, this option allows moving a VM and all its items from one location to another. At this point, it should be noted that data will be transferred without being divided by the catalogs that were created while setting up Hyper-V.

Зображення, що містить текст, знімок екрана, програмне забезпечення, Веб-сторінка Автоматично згенерований опис

2. Now, let’s look at the Move the virtual machine’s data by selecting where to move items option in detail since there are three ways to move the storage.

db8db83c913eef65f8008eab3dc24373

2.1. Move the virtual machine’s data automatically. Migration wizard finds the VM storage location and moves the data in the same directory as they were located on the parent host.

930c930667f56077b1c3970fe15fd696

2.2. Move the virtual machine’s virtual hard disks to different locations. This option allows specifying the location to move for each VM element. You also can move VM disks to different locations. Even if the VM uses several virtual disks, you can select the necessary items and set the new location on the remote host.

ee881d306f53d03b45d522cdbbd146bf

2.3. Move the virtual machine’s items to different location allows migrating VM items to different directories.

73135aaacac4327484430eb44028d9f2

3. The Move only the virtual machine option enables to move only the VM without relocating any of its items. Keep in mind that VM items should reside on the shared storage that can be accessed both by the target and destination hosts. It can be a NAS device, a file server, a shared cluster disk, or just a shared folder.

318313abcb24ac4963575de45097fec0

And, finally, the migration starts. The VM won’t be shut down and keeps on working as usual.

Зображення, що містить текст, програмне забезпечення, знімок екрана, Комп’ютерна піктограма Автоматично згенерований опис

And, that’s it! The VM has been migrated non-disruptively.

Зображення, що містить текст, програмне забезпечення, Комп’ютерна піктограма, Мультимедійне програмне забезпечення Автоматично згенерований опис

CONCLUSION

Today, I’ve discussed some Hyper-V live migration settings and how to ensure high performance of this process. Well, it is not an in-depth study. Here, I rather discussed the key points about live migration settings and the migration wizard. Should you need more details any specific live migration settings, just do a little googling.

Always use SMB as a protocol. It allows using network bandwidth and CPU smarter. However, if you can allocate some compute resource for compression, go ahead and use compression.

Now, just a couple of words about each option of VM migration:

  • Move the virtual machine’s data automatically is great if you have identical configurations of virtual disks and VM descriptions on both hosts.
  • Move the virtual machine’s items to different locations works great if you want to keep VM items separately and you want to specify where they should be kept.
  • Move only the virtual machine just migrates the VM from host to host. For my money, it is the best way to migrate a VM as there won’t be massive data transfers and network won’t be bottlenecked.
Found Dmitriy’s article helpful? Looking for a reliable, high-performance, and cost-effective shared storage solution for your production cluster?
Dmytro Malynka
Dmytro Malynka StarWind Virtual SAN Product Manager
We’ve got you covered! StarWind Virtual SAN (VSAN) is specifically designed to provide highly-available shared storage for Hyper-V, vSphere, and KVM clusters. With StarWind VSAN, simplicity is key: utilize the local disks of your hypervisor hosts and create shared HA storage for your VMs. Interested in learning more? Book a short StarWind VSAN demo now and see it in action!