Updated: October 26, 2009
Applies To: Windows Server 2008 R2
This guide details the steps required to perform a live migration of Hyper-V™ virtual machines from one node in a Windows Server® 2008 R2 failover cluster to another node.
Live migration is a new Hyper-V feature in Windows Server 2008 R2, which requires the failover clustering feature to be added and configured on the servers running Hyper-V. Hyper-V and failover clustering can be used together to make a virtual machine that is highly available, thereby minimizing disruptions and interruptions to clients. Live migration allows you to transparently move running virtual machines from one node of the failover cluster to another node in the same cluster without a dropped network connection or perceived downtime. In addition, failover clustering requires shared storage for the cluster nodes. This can include an iSCSI or Fiber-Channel Storage Area Network (SAN). All virtual machines are stored in the shared storage area, and the running virtual machine state is managed by one of the nodes. For a detailed overview of live migration and the benefits of using it, see Windows Server 2008 R2 Hyper-V Live Migration.
The following recommendations will help you configure your networking environment for using live migration:
Hyper-V provides processor compatibility settings to make it easier to perform a live migration of a virtual machine to another physical computer with a different processor version. The Migrate to a physical computer with a different processor version setting in Hyper-V Manager allows you to move a running virtual machine to a physical computer with different processor features without restarting the virtual machine. It is recommended that you enable this setting in Hyper-V Manager to ensure that the virtual machine uses only the features of the processor that are available on all versions of a virtualization-capable processor by the same processor manufacturer. It does not provide compatibility between different processor manufacturers. When this setting is not used, Hyper-V provides the virtual machine with all the virtualization features offered by the physical processor. The setting is also useful for high availability and backup and recovery scenarios because it makes it easier to move a highly available virtual machine to another node in a cluster or restore the virtual machine to different hardware.
You should avoid taking a snapshot of a running virtual machine. If you revert back to a snapshot of a running virtual machine, the memory state is restored in addition to the disk. Before reverting a clustered virtual machine back to a snapshot, you should first shut down the virtual machine from Failover Cluster Manager, take a snapshot of the virtual machine, and restart the virtual machine.
Because live migration is a transition state, the Hyper-V VSS writer waits for the migration to complete before continuing with backup. However, once migration is complete, the virtual machine is no longer on the cluster node on which backup occurs. At this stage, backup continues and correctly backs up the files (it can still access the files on the CSV volume), but it is only a file copy. The VSS writer does not perform the steps that it usually would for an online backup. You should be aware that the VSS writer does not return a failure error code to VSS, and therefore, does not log any errors. However, it does log two warning messages that the virtual machine is not found.
Use the following steps to implement live migration:
Cluster Shared Volumes are volumes in a failover cluster that multiple nodes can read from and write to at the same time. The nodes coordinate the reading and writing activity so that the disk is not corrupted. In contrast, disks (LUNs) in cluster storage that are not Cluster Shared Volumes are always owned by a single node. Cluster Shared Volumes have the same requirements as non-Cluster Shared Volumes disk resources. The storage location in the Cluster Shared Volumes is under SystemDrive/ClusterStorage. When creating the virtual machine, we recommend that you use this storage location.
It is recommended that you first validate the cluster configuration before configuring Cluster Shared Volumes. For more information about how to validate a cluster configuration, see the Failover Cluster Step-by-Step Guide: Validating Hardware for a Failover Cluster and The Microsoft Support Policy for Windows Server 2008 Failover Clusters.
In the Failover Cluster Manager snap-in, if the cluster that you want to configure is not displayed, in the console tree, right-click Failover Cluster Manager, click Manage a Cluster, and then select or specify the cluster that you want.
Right-click the failover cluster, and then click Enable Cluster Shared Volumes. Or, under Configure (center pane), click Enable Cluster Shared Volumes. The Enable Cluster Shared Volumes dialog box opens. Read and accept the terms and restrictions, and click OK.
If the console tree is collapsed, expand the tree under the cluster that you want to add a disk to the Cluster Shared Volumes.
Click Cluster Shared Volumes.
Under Actions (on the right), click Add storage.
In Add Storage, select from the list of available disks, and click OK. The disk or disks you selected appear in the Results pane for Cluster Shared Volumes.
The storage location appears as SystemDrive\ClusterStorage (which you can rename) on all nodes of the failover cluster. Under SystemDrive\ClusterStorage, a specific folder appears for each volume on the disk (or disks) that was added to the Cluster Shared Volumes. You can view the list of volumes in Failover Cluster Manager.
To set up a virtual machine for live migration, you need to do the following:
For information about how to perform these procedures, see Steps 6 and 7 in Hyper-V Step-by-Step Guide: Hyper-V and Failover Clustering.
Cluster networks are automatically configured for live migration. You can use Failover Cluster Manager to perform this procedure.
Expand Services and applications.
In the console tree (on the left), select the clustered virtual machine for which you want to configure the network for live migration.
Right-click the virtual machine resource displayed in the center pane (not on the left), and then click Properties.
Click the Network for live migration tab, and select one or more cluster networks to use for live migration. Use the buttons on the right to move the cluster networks up or down to ensure that a private cluster network is the most preferred. The default preference order is as follows: networks that have no default gateway should be located first; networks that are used by cluster shared volumes and cluster traffic should be located last.
Live migration will be attempted in the order of the networks specified in the list of cluster networks. If the connection to the destination node using the first network is not successful, the next network in the list is used until the complete list is exhausted, or there is a successful connection to the destination node using one of the networks.
You can use either Failover Cluster Manager or PowerShell to initiate live migration to move a virtual machine from one node to another node in a failover cluster.
The amount of time it takes to move a virtual machine using live migration is dependent on the following items:
Expand Nodes.
In the console tree (on the left), select the node under which you want to move a clustered virtual machine using live migration.
Right-click the virtual machine resource displayed in the center pane (not on the left), and then click Live migrate virtual machine to another node.
Select the node that you want to move the virtual machine to. When migration is complete, the virtual machine is running on the new node.
To verify that the virtual machine successfully migrated, you will see the virtual machine listed under the new node (in Current Owner).
Open PowerShell. Click Start, point to All Programs, click Windows Powershell 2.0, and then click Windows Powershell 2.0.
The Failover Clustering feature must be installed on the computer on which you are starting the PowerShell session.
To install the Failover Clustering feature, type:
Add-Module FailoverClusters
Type:
Get-Cluster “<Cluster Name>” | Move-ClusterVirtualMachineRole -Name “<VM group name>” -Node “<Destination node name>”
Where:
This section covers some of the issues that you may encounter when you are performing a live migration. Before you review the troubleshooting items in this section, you should confirm that:
The following list covers some of the basic live migration troubleshooting issues.
The following list outlines the configuration information that will help diagnose troubleshooting issues.
Cluster information:
Network information:
Virtual machine information:
To help diagnose troubleshooting issues, you can retrieve Hyper-V and cluster event log information.
Wevtutil sl “<Log Name>” /e:true /q
Wevtutil epl query.txt /sq:true <Log Name>.evtx
<QueryList> <Query Id="0" Path="System"> <Select Path="System">*[System[Provider[@Name='Microsoft-Windows-Hyper-V-Hypervisor']]]</Select> <Select Path="Microsoft-Windows-Hyper-V-Config-Admin">*</Select> <Select Path="Microsoft-Windows-Hyper-V-High-Availability-Admin">*</Select> <Select Path="Microsoft-Windows-Hyper-V-High-Availability-Analytic">*</Select> <Select Path="Microsoft-Windows-Hyper-V-Hypervisor-Admin">*</Select> <Select Path="Microsoft-Windows-Hyper-V-Integration-Admin">*</Select> <Select Path="Microsoft-Windows-Hyper-V-Network-Admin">*</Select> <Select Path="Microsoft-Windows-Hyper-V-SynthStor-Admin">*</Select> <Select Path="Microsoft-Windows-Hyper-V-SynthNic-Admin">*</Select> <Select Path="Microsoft-Windows-Hyper-V-Image-Management-Service-Admin">*</Select> <Select Path="Microsoft-Windows-Hyper-V-VMMS-Admin">*</Select> <Select Path="Microsoft-Windows-Hyper-V-Worker-Admin">*</Select> </Query> </QueryList>
Get-ClusterLog
Get-ClusterLog –Destination <logdir>
Cluster.exe log /g /copy:<logdir>