In server virtualization, in order to maintain the optimal utilization of physical resources and easily add new virtual machines, IT must be able to move virtual machines without impacting the business directly when needed. The ability to move a virtual machine across a hyper-V host was first seen in Windows Server R2, when it was implemented by a feature called Live migration, but the feature required that the virtual machine must be in a shared storage or cluster and not be able to move multiple virtual machines at the same time. In Windows Server 2012/r2, Hyper-V has a number of new and improved migration capabilities that provide greater flexibility for customers who need to migrate loads in the datacenter.
1. Live Migration:
The Hyper-V Live Migration feature does not affect the user's use of the virtual machine, moving the running virtual machine from one physical server to another. Live migration minimizes the time it takes to transfer virtual machines by pre-replicating the memory content of the virtual machine to be migrated to the target server. Live migration is accurate, meaning that a live migration initiated by an administrator or script will determine which computer is the destination for the migration. The guest operating system for the virtual machine to be migrated does not know that the migration operation is in progress and the guest operating system does not need any special configuration.
After an administrator initiates a live migration through Hyper-V Manager or Hyper-V PowerShell, the following actions occur:
1) Live Migration Settings – during the setup phase of live migration, the source server creates a connection with the destination server. This connection is used to transfer the configuration of the virtual machine to the destination server. The framework virtual machine is created on the target server and the allocated memory is obtained.
2) transferring memory pages from the source node to the target node – in the second phase of live migration, the memory allocated to the virtual machine to be migrated is replicated over the network to the destination server. This memory is also called the "working set" of the virtual machine to be migrated. The page size of the memory is 4KB.
For example, the virtual machine "BJ-SERVER-01" is configured with 2G of memory and needs to be migrated to another Hyper-V server. The entire 2G of memory allocated to a virtual machine is the working set of "bj-server-01". The working set page used by "bj-server-01" is copied to the target server.
In addition to copying the working set of "bj-server-01" to the target server, Hyper-V also monitors the working set of bj-server-01 on the source server. Once the "bj-server-01" memory page changes, the page is recorded and marked as modified. The modified page is actually the list of memory pages that have been modified on "bj-server-01" since the start of copying the working set.
At this stage of the migration effort, the virtual machines to be migrated are still running. Hyper-V repeatedly performs a memory copy operation, reducing the number of changed pages that are required to replicate each time you execute. After the entire working set is copied to the destination server, the next stage of the live migration is about to begin.
3) changed page transfer complete – the third phase of the live migration requires that the remaining modified memory pages of "bj-server-01" be copied to the target server. The source server transmits the CPU and device state information for the virtual machine to the destination server.
At this stage, the network bandwidth available between the source and the target server is the key to the real-time migration speed. It is recommended to use 1Gigabit Ethernet or higher speed connections. The faster the source server transfers the changed pages of the virtual machine working set to be migrated, the faster the live migration operation can be completed.
The number of pages transferred at this stage depends on how often the virtual machine accesses and modifies memory pages. The more pages you modify, the longer it takes for all pages to be transferred to the destination server.
After the modified memory page is fully replicated to the target server, the target server has the latest working set of "bj-server-01". The state of the "bj-server-01" working set on the target server is exactly the same as when the migration process starts.
4) The processing of the storage is delivered to the target server by the source server – during the fourth phase of the live migration, you need to control the storage associated with "bj-server-01", such as any virtual disk files, or physical storage connected through a virtual fiber adapter, to the destination server.
5) The virtual machine is on the target server – in phase fifth of the live migration, the target server already has the latest working set of "bj-server-01" and can access all the storage required by "bj-server-01". You can restore "bj-server-01" at this time.
6) Network cleanup – during the last phase of the live migration, the migrated virtual machines start running on the target server. A message is also sent to the network switch at this point. This message causes the network switch to obtain the new MAC address of the migrated virtual machine so that the "bj-server-01" receives or sends the network traffic to use the correct switch port.
The live migration process does not finish longer than the TCP timeout interval for the virtual machine to be migrated. The TCP timeout interval depends on the network topology and many other factors that affect the speed of live migration:
A) The number of pages to be migrated from the virtual machine-the larger the number of pages changed, the longer the virtual machine is in the migration state.
b) The network bandwidth available between the source and the destination server.
c) The hardware configuration of the source and destination server.
d) The load from the source to the target server.
e) The available bandwidth (network or Fibre Channel) between the server running Hyper-V and the shared storage.
2. SMB-based Live migration:
In Windows Server R2 Hyper-V, you can configure virtual machines to use SMB file shares as storage. You can then perform a live migration between hyper-V host computers running on a non-clustered server, while the virtual machine's storage remains within the SMB store. This allows you to gain the benefits of virtual machine portability without having to secure environment availability, but without investing in the cluster infrastructure (if high availability is required, you can also configure Hyper-V with SMB storage as a failover cluster).
This feature is not mobile for virtual machines that use SMB 3.0 file share storage virtual disks, real-time migration through SMB is a second performance improvement for live migration, and can take advantage of technologies from the SMB protocol for faster real-time migration than compression technology.
By using SMB live migration, the memory content of the virtual machine needs to be replicated through the network transport through SMB 3.0. This means that you can take advantage of some of the benefits of SMB functionality to speed up this process. First, more network cards can be added to the host, and the host will use the SMB multichannel feature to increase the transfer speed while improving adaptability and redundancy for network card and path failures. Second, SMB Passthrough features that support remote Direct memory access, which is RDMA-capable network card hardware such as IWARP (Ten Gbps), ROCE (10/40 Gbps), or Infiniband (56Gbps Gbps), for maximum performance up to 。 RDMA-capable network adapters can run at full speed with low latency while also causing very low CPU overhead.
650) this.width=650; "height=" 378 "title=" clip_image002 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image002 "src=" http://s3.51cto.com/wyfs02/ M00/57/a7/wkiol1shwhvipggraaep6bgqijc696.jpg "border=" 0 "/>
By using SMB multichannel, SMB detects an RDMA-capable network adapter and creates multiple RDMA connections for a single session (two connections per port). This enables SMB to use features such as high throughput, low latency, and low CPU overhead provided by RDMA network adapters. Fault tolerance support is also obtained when using multiple RDMA interfaces.
When Microsoft released the technology, the internal test found that the CPU, disk, and network were no longer bottlenecks by providing the host with enough RDMA NICs and all of them for real-time migration-in fact, the bottleneck that affected the speed of real-time migration became the memory itself.
3. Faster parallel migrations:
Windows Server R2 Hyper-V performs multiple live migrations at the same time to more quickly move multiple virtual machines across a cluster. If you want to switch a heavily loaded host to maintenance mode, this feature will make it much easier for you to quickly move the virtual machine out of the host. In Windows Server R2 Hyper-V, virtual machines can move from the source host to other destination hosts at the same time, making fuller use of the available network bandwidth without causing a load outage.
4. Live Migration with compression:
In Windows Server R2, there are several performance-specific improvements that can help you achieve real-time migrations faster and make your operations smoother and more efficient. In a large-scale environment, such as a private cloud or a cloud-hosted vendor environment, these performance improvements can reduce network and CPU overhead and reduce the time required for real-time migrations. Hyper-V Administrators can configure the required live migration performance options based on the environment and specific requirements. Live migration Performance options can be configured in the host settings of the Hyper-V Manager console, or use the Set-vmhost Windows PowerShell cmdlet and apply it to all live migration actions initiated by the host.
650) this.width=650; "height=" 337 "title=" clip_image004 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image004 "src=" http://s3.51cto.com/wyfs02/ M01/57/aa/wkiom1shv8vhbz59aadm8tcr4w8298.jpg "border=" 0 "/>
5. Storage Live Migration:
Windows Server R2 Hyper-V can migrate virtual machine storage only if the virtual machine is shut down. The ability to manage storage flexibly is a key factor in many organizations that do not affect the availability of virtual machine workloads. IT administrators need this flexibility to perform maintenance on the storage subsystem, upgrade the storage device's firmware and software, and weigh the load and capacity as needed. Windows Server R2 lets you move running virtual machine instances through live migration, but still cannot move virtual machine storage while the virtual machine is running.
Hyper-V in Windows Server R2 provides a feature called live storage migration that lets you move virtual disks of a running virtual machine to another location. This feature allows you to transfer virtual disks to a new storage location after upgrade or migration, perform storage maintenance on the backend, or allocate storage load. You can do this either through the new wizard in Hyper-V Manager, or by using the new Hyper-V Windows PowerShell cmdlet. Live storage migrations are available for storage Area network (SAN) and file-based storage.
When you move a virtual disk running in a virtual machine, hyper-V moves the storage using the following steps:
1. For most operations, disk reads and writes are made for the source virtual disk.
2. Although read and write operations are made for the source virtual disk, the disk contents are also copied to the new destination virtual disk.
3. When the initial disk copy operation is complete, the disk write operation is made for both the source and destination virtual disks, and all changes that have not yet been replicated are copied to the destination disk.
4. When the source is synchronized with the destination virtual disk, the virtual opportunity switches to use the target virtual disk.
5. The source virtual disk is deleted.
Similar to how virtual machines move dynamically in the datacenter, the storage allocated for running virtual disks sometimes needs to be moved to achieve storage load distribution, storage device maintenance, or other scenarios.
The most common reason to update Hyper-V available physical storage is to move virtual machine storage. You may also want to move the storage of virtual machines between physical storage devices at any time to take advantage of the new, low-cost storage that is newly supported by Hyper-V (for example, SMB-based storage), or to eliminate the performance impact of performance bottlenecks caused by storage throughput rates. Windows Server R2 provides the flexibility to move virtual disks between shared and unshared storage subsystems as long as the Hyper-V host can use the SMB 3.0 network shared folder.
You can add physical storage for stand-alone systems or hyper-V clusters, and then move virtual disks of virtual machines to new physical storage, a process that does not affect the proper functioning of the virtual machine.
By using storage migration with live migration, you can move virtual machines between different server hosts that use different storage. For example, if two hyper-V servers are configured to use different storage devices, to migrate virtual machines between the two servers, you can use the storage migration feature to migrate the storage to a file server shared folder that both servers can access. The virtual machines are then migrated between the two servers (because they both have access to this share). With live migration, you can also use other storage migration features to move virtual disks to storage that is assigned to the destination server, or to use a live migration without sharing.
6. No shared Live migration:
Microsoft's non-shared migration technology first appeared in Windows Server 8, which, once released, caused the industry to make the most of the migration effort with Hyper-V no-share migration technology.
No shared live migration allows an IT administrator to move a running virtual machine and virtual disk from one location to another without causing downtime. This feature enables migration of virtual machines to implement a variety of new scenarios:
1) Use a standalone host that is stored locally to a standalone host that uses local storage
2) Use a standalone host that is stored locally to a clustered host that uses SAN storage
3) Use a clustered host of SAN storage to a different clustered host that uses another SAN storage
There are multiple steps involved in a live migration without sharing. First, when you migrate a virtual machine between two computers that do not use a shared infrastructure, the source server creates a connection to the destination server. This connection is used to transfer virtual machine configuration data to the destination server. At this point, you need to create a framework virtual machine on the target server and allocate the memory required for the target virtual machine.
650) this.width=650; "height=" 395 "title=" clip_image006 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image006 "src=" http://s3.51cto.com/wyfs02/ M02/57/aa/wkiom1shv8uy-krmaafebozwtfq462.jpg "border=" 0 "/>
After the configuration data is successfully transferred, the disk contents are also transferred.
650) this.width=650; "height=" 445 "title=" clip_image008 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image008 "src=" http://s3.51cto.com/wyfs02/ M00/57/aa/wkiom1shv8vstgleaae243rn2hi521.jpg "border=" 0 "/>
During this process, the read and write operations are still made for the source virtual disk. When the initial disk copy operation is complete, the disk writes are made to both the source and destination virtual disks, and the unhandled disk changes are replicated.
650) this.width=650; "height=" 427 "title=" clip_image010 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image010 "src=" http://s3.51cto.com/wyfs02/ M01/57/aa/wkiom1shv8vzf8pzaafhfm3blle759.jpg "border=" 0 "/>
When the source is synchronized with the destination virtual disk, the virtual machine Live migration operation is initiated, and the subsequent process is similar to a live migration using shared storage.
650) this.width=650; "height=" 397 "title=" clip_image012 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image012 "src=" http://s3.51cto.com/wyfs02/ M02/57/aa/wkiom1shv8zy8unbaae3s8htpas153.jpg "border=" 0 "/>
When the live migration operation finishes, the virtual machine is successfully run on the target server, and the files on the source server are deleted.
650) this.width=650; "height=" 398 "title=" clip_image014 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image014 "src=" http://s3.51cto.com/wyfs02/ M01/57/a7/wkiol1shwh-y0lfnaadjm--tbvo078.jpg "border=" 0 "/>
7. Cross-version Live migration
In older versions of Windows Server, migrating to a new version of the platform resulted in significant load downtime because the virtual machines needed to be exported from the legacy platform and imported into the new platform. However, in Windows Server R2 Hyper-V, customers can upgrade from Windows Server-Hyper-V without downtime, so these critical loads can be migrated seamlessly and efficiently. Note, however, that you cannot downgrade the migration. , that is, you cannot migrate virtual machines in Windows Server R2 Hyper-V to Windows Server, Hyper-V
If an enterprise administrator wants to use the migration technology described above, the following prerequisites are required:
1. Windows Server R2 or Hyper-V server R2 with Hyper-V.
2. At least two Hyper-V host computers that support hardware virtualization and use the same architecture processor (for example, AMD or Same as Intel).
3. The Hyper-V host must reside in an active Directory domain.
4. The virtual machine is configured to use a virtual disk or a virtual Fibre Channel disk.
5. Private network for live migration of network traffic.
6. SMB Passthrough for SMB Live migration requires hardware that supports RDMA technology.
If the virtual machine is in a clustered environment, use the migration technology to ensure that the prerequisites are:
1. All files of the virtual machine, including virtual disks, snapshots, and configurations, are saved in the SMB 3.0 share.
2. The permissions for the SMB share are configured to allow access to computer accounts for all Hyper-V host computers.
The following demonstrates the non-shared storage migration technology for a cluster-dependent environment, which is described in the cluster section
1. Log in to the Hyper-V host "bj-vmhost-01" and "bj-vmhost-01", open Hyper-V Manager, right-side action area, click Hyper-V Settings
650) this.width=650; "height=" 484 "title=" clip_image016 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image016 "src=" http://s3.51cto.com/wyfs02/ M00/57/aa/wkiom1shv8zhjiocaaf5i1dj50s703.jpg "border=" 0 "/>
2. Hyper-V Global Settings page, click Live Migration, tick "enable incoming and outgoing live migration", specify the number of concurrent live migrations allowed, default to 2, and set the incoming Live Migration network, set any network and specify IP network Live migration
650) this.width=650; "height=" 488 "title=" clip_image018 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image018 "src=" http://s3.51cto.com/wyfs02/ M01/57/aa/wkiom1shv8zgxg6jaaigohgehmy550.jpg "border=" 0 "/>
3. Click Advanced Features to choose to set the authentication protocol, which provides "Use credential Security Support Provider (CredSSP)" and "Use Kerberos" protocol.
650) this.width=650; "height=" 283 "title=" clip_image020 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image020 "src=" http://s3.51cto.com/wyfs02/ M02/57/aa/wkiom1shv82gjtijaagdkqcgwbk394.jpg "border=" 0 "/>
4. Performance Options page, Microsoft provides TCP/IP, compression, SMB three ways, by default, the use of compressed mode of migrating virtual machines
650) this.width=650; "height=" 335 "title=" clip_image022 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image022 "src=" http://s3.51cto.com/wyfs02/ M00/57/aa/wkiom1shv87s-lwdaahdgggysk0389.jpg "border=" 0 "/>
5. Click Storage Migration, specify the number of concurrent storage migrations, default to 2
650) this.width=650; "height=" 420 "title=" clip_image024 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image024 "src=" http://s3.51cto.com/wyfs02/ M01/57/aa/wkiom1shv86g0n_4aahh_zrs0p8606.jpg "border=" 0 "/>
6. Right-click the running virtual machine "bj-server-02" and select Move
650) this.width=650; "height=" 490 "title=" clip_image026 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image026 "src=" http://s3.51cto.com/wyfs02/ M01/57/aa/wkiom1shv8-ygff4aagqgsmqvcy274.jpg "border=" 0 "/>
7. Move the Virtual Machine Wizard page and click Next
8. Select the Mobile Type page, where you can choose to move the virtual machine or move the storage of the virtual machine, click Next
650) this.width=650; "height=" 333 "title=" clip_image028 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image028 "src=" http://s3.51cto.com/wyfs02/ M00/57/a7/wkiol1shwipaszcuaafdgzyaww0965.jpg "border=" 0 "/>
9. Specify the target computer page, type the target computer name, and click Next
650) this.width=650; "height=" 499 "title=" clip_image030 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image030 "src=" http://s3.51cto.com/wyfs02/ M02/57/a7/wkiol1shwiozmekuaagww7gywwo429.jpg "border=" 0 "/>
10. Move the Options page, select how you want to use the virtual machine, click Next
1) Move the virtual machine's data to a single location: This option allows you to specify a location for all items of the virtual machine
2) Move the virtual machine's data by selecting the project move location: This option allows you to select the location of each item you want to move
3) Move virtual machines only: This option allows you to move only the virtual machine without moving the virtual hard disk. Virtual hard disks must reside in shared storage
650) this.width=650; "height=" 430 "title=" clip_image032 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image032 "src=" http://s3.51cto.com/wyfs02/ M02/57/aa/wkiom1shv9hcss79aahllqpg0o4015.jpg "border=" 0 "/>
11. Because the Hyper-V host is already specified, only the folder path is shown here, click Next
650) this.width=650; "height=" 331 "title=" clip_image034 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image034 "src=" http://s3.51cto.com/wyfs02/ M00/57/a7/wkiol1shwitxq-6waafoboidzlw342.jpg "border=" 0 "/>
12. Completing the Virtual Machine Move Wizard page, confirm that all information is correct and click Finish
650) this.width=650; "height=" 499 "title=" clip_image036 "style=" margin:0px;border:0px;padding-top:0px; Padding-right:0px;padding-left:0px;background-image:none, "alt=" clip_image036 "src=" http://s3.51cto.com/wyfs02/ M02/57/aa/wkiom1shv9gj2ue7aagwhxtnptc524.jpg "border=" 0 "/>
13. Wait for the migration to complete
650) this.width=650; "height=" 451 "title=" clip_image038 "style=" border:0px;padding-top:0px;padding-right:0px; Padding-left:0px;background-image:none, "alt=" clip_image038 "src=" http://s3.51cto.com/wyfs02/M00/57/AA/ Wkiom1shv9lssy13aagpp6ntrua426.jpg "border=" 0 "/>
This article is from the "Xu Ting blog" blog, make sure to keep this source http://ericxuting.blog.51cto.com/8995534/1597503
Hyper-V Server virtual machine mobility