Compartir a través de


Migrating Clustered Virtual Machines to Windows Server 2008 R2

Applies To: Windows Server 2008 R2

This guide explains how to migrate your Hyper-V™ virtual machines that are in a failover cluster running Windows Server® 2008 to a failover cluster running Windows Server 2008 R2.

Migrating Hyper-V virtual machines that are in a failover cluster

For virtual machines in a failover cluster running Windows Server 2008, you perform the following steps to upgrade the virtual machines and clusters to Windows Server 2008 R2:

  • Step 1: Migrate virtual machines to a different subset of cluster nodes

  • Step 2: Evict the original cluster nodes

  • Step 3: Perform a clean installation of Windows Server 2008 R2 and enable Hyper-V and the failover clustering feature

  • Step 4: Create a new cluster with the evicted nodes

  • Step 5: Configure Cluster Shared Volumes

  • Step 6: Prepare the virtual machines in the original cluster for migration

  • Step 7: Migrate the virtual machines to the cluster running Windows Server 2008 R2

  • Step 8: Remove the original failover cluster

  • Step 9: Perform a clean installation of Windows Server 2008 R2 on the remaining nodes

Step 1: Migrate virtual machines to a different subset of cluster nodes

Use the following procedure to perform a quick migration of virtual machines to a different subset of cluster nodes. The virtual machines must be migrated to a subset of nodes that has adequate size to store the virtual machines and that are still running Windows Server 2008.

To quick migrate virtual machines to a different subset of cluster nodes

  1. In the Failover Cluster Manager snap-in, select or specify the cluster that you want.

  2. If the console tree is collapsed, expand the tree under the cluster that you want to configure.

  3. Expand Services and Applications, and then click the clustered instances that contain the virtual machines you want to migrate.

  4. Under Actions (on the right), click Quick migrate virtual machine(s) to another node.

Step 2: Evict the original cluster nodes

Before you evict the original subset of cluster nodes, make sure that the nodes you are evicting do not have access to the shared storage of the original cluster.

To evict the original cluster nodes

  1. In the Failover Cluster Manager snap-in, select or specify the cluster that you want.

  2. Right-click the nodes you want to evict, click Move Actions, and then click Evict.

Step 3: Perform a clean installation of Windows Server 2008 R2 and enable Hyper-V and the failover clustering feature

On the evicted subset of nodes, perform a clean installation of Windows Server 2008 R2 (upgrading is not supported in a failover cluster), and then enable Hyper-V and install the failover clustering feature. For more information about how to perform these steps, see the Hyper-V Planning and Deployment Guide (https://go.microsoft.com/fwlink/?LinkID=108560) and the Hyper-V Step-by-Step Guide: Hyper-V and Failover Clustering (https://go.microsoft.com/fwlink/?LinkID=129063).

Step 4: Create a new cluster with the evicted nodes

Before you create a failover cluster, we strongly recommend that you validate your configuration by running all tests in the Validate a Configuration Wizard. When you run the tests, you can confirm that your hardware and settings are compatible with failover clustering. For more information on validating the cluster configuration, see the Failover Cluster Step-by-Step Guide: Validating Hardware for a Failover Cluster (https://go.microsoft.com/fwlink/?LinkID=119949).

After validation is complete, configure the evicted nodes as nodes in a failover cluster. For more information, see the Failover Cluster Deployment Guide (https://go.microsoft.com/fwlink/?LinkId=129457).

Step 5: Configure Cluster Shared Volumes

If applicable, enable Cluster Shared Volumes (CSV) and add disks to the CSV. For more information, see Hyper-V: Using Live Migration with Cluster Shared Volumes in Windows Server 2008 R2 (https://go.microsoft.com/fwlink/?LinkId=164729).

Step 6: Prepare the virtual machines in the original cluster for migration

The action you take to prepare the virtual machines depends on the state of the virtual machines.

  • If the virtual machine is in a Running state, use Hyper-V Manager to shut down the virtual machines.

  • If the virtual machine is in a Saved state, use Failover Cluster Manager to take the virtual machines offline. Under Services and Applications, select the virtual machines that you want to take offline. In the results pane, right-click each virtual machine, and then click Take this resource offline. The Saved state is not supported when you upgrade to Windows Server 2008 R2.

Note

If a virtual machine has a snapshot that you need, apply the snapshot, and then shut down the virtual machine.
If you are migrating the virtual machines to a CSV disk, you should follow the procedure in Migrating virtual machines to a Cluster Shared Volume disk before you prepare the virtual machines for migration.

To prepare the virtual machines for migration

  1. Take one of the following actions to prepare for migrating the machines:

    • Export the virtual machines. If you plan to use the same SAN storage for the Windows Server 2008 R2 cluster, you can use a configuration-only export. Use Hyper-V Manager to export the virtual machines by selecting Export on the Action menu. Make sure to select the Export only the virtual machine configuration check box.

    • Back up the virtual machines by using a backup application of your choice.

  2. Use Failover Cluster Manager to take the virtual machines offline. Under Services and Applications, select the virtual machines that you want to take offline. In the results pane, right-click each virtual machine, and then click Take this resource offline.

  3. If you plan to reuse the storage for the new cluster, make sure it does not have access to the original cluster, and then make it available to the new failover cluster that is running Windows Server 2008 R2. To make it available to the new failover cluster, use Failover Cluster Manager. Under Services and Applications, click the service or application that you want to add storage to. Under Actions, click Add storage and select the disk or disks that you want to add.

Step 7: Migrate the virtual machines to the cluster running Windows Server 2008 R2

The steps you take to migrate the virtual machines to Windows Server 2008 R2 depend on whether you exported or backed up the virtual machines.

To migrate the virtual machines to the new cluster

  1. To migrate the virtual machines, do one of the following:

    • If you exported the virtual machines, you should import the virtual machines back to the cluster nodes. To import the virtual machines, follow the steps in Exporting and importing virtual machines in failover clusters.

    • If you backed up the virtual machines, use a backup application to restore the virtual machine to the clustered disk.

  2. For each of the virtual machines that are now in the cluster running Windows Server 2008 R2, you should update the integration services. To do this, turn on the virtual machine. In the Action menu of Virtual Machine Connection, click Insert Integration Services Setup Disk.

Note

In Windows Server 2008 R2, the integration services for Windows Vista® and Windows Server 2008 are listed in Programs and Features as "KB955484."

Step 8: Remove the original failover cluster

When all of the virtual machines are in the cluster that is running Windows Server 2008 R2, and the cluster has been tested and verified as fully functional, use Failover Cluster Manager to remove the original cluster.

To remove a failover cluster

  1. In the Failover Cluster Manager snap-in, right-click the cluster you want to remove, click More Actions, and then click Destroy Cluster.

Step 9: Perform a clean installation of Windows Server 2008 R2 on the remaining nodes

For the remaining nodes from the original cluster, perform a clean installation of Windows Server 2008 R2. Then enable the Hyper-V role and the failover clustering feature. Join these nodes to the new cluster.

Migrating virtual machines to a Cluster Shared Volume disk

Cluster Shared Volumes (CSV) is a new failover clustering feature in Windows Server 2008 R2. When you migrate virtual machines from a cluster running Windows Server 2008 to a cluster running Windows Server 2008 R2, you can migrate the virtual machines to a CSV disk in the Windows Server 2008 R2 cluster.

To migrate virtual machines to a Cluster Shared Volume disk

  1. Export the virtual machines by using one of the following options:

    1. Use Hyper-V Manager to move the virtual hard disks with the virtual machine configurations. From the Action menu in Hyper-V Manager, click Export, and then specify the folder that you want to export the virtual machine to. Make sure that the Export only the virtual machine configuration check box is cleared.

    2. Export the virtual machine to the CSV folder (systemdrive\clusterstorage\volume1) to gain more control over the location of the virtual hard disks during the migration. From the Action menu in Hyper-V Manager, click Export, and then select Export only the virtual machine configuration.

  2. From Hyper-V Manager, delete the virtual machines by selecting all of the virtual machines, and then under Actions, click Delete.

  3. Add storage to the cluster’s Available Storage group.

    To add a disk to Cluster Shared Volumes

    1. In the Failover Cluster Manager snap-in, select or specify the cluster that you want.

    2. If the console tree is collapsed, expand the tree under the cluster where you want to add the disk to the Cluster Shared Volumes.

    3. Click Cluster Shared Volumes.

    4. Under Actions, click Add storage.

    5. In Add Storage, select from the list of available disks, and click OK. The disk you selected appear in the Results pane for Cluster Shared Volumes.

  4. In Hyper-V Manager, right-click the virtual machines you want to import, and then click Import.

  5. Use Failover Cluster Manager to make the virtual machines highly available. For information about how to perform this procedure, see Step 7 in Hyper-V Step-by-Step Guide: Hyper-V and Failover Clustering (https://go.microsoft.com/fwlink/?LinkID=129063).

Exporting and importing virtual machines in failover clusters

Use the procedures in this section to export and then import your virtual machines.

To export the virtual machines

  1. To perform a configuration-only export of the virtual machines, run the script, GetAssociatedVHDLocations, to obtain the list of snapshot .avhd files and the .vhd files that are associated with the virtual machines. To find this script, see the Microsoft TechNet Script Center (https://go.microsoft.com/fwlink/?LinkId=177857).

  2. To run the script, type the following:

    cscript GetAssociatedVHDLocations.vbs /VMName:Name of virtual machine

  3. In the script output, copy the .avhd files that are listed under “ChildPaths” to the same folder as the .vhd folder that is specified under ”ParentPath” in the output.

To import the virtual machines

  1. To import the virtual machines, run the script, ImportVM, which you can find at the Microsoft TechNet Script Center (https://go.microsoft.com/fwlink/?LinkId=177858).

Note

You need to specify the Export Path folder that was created during the export, not the folder that you used to export the virtual machine.

  1. If you are migrating virtual machines from a non-CSV storage environment to another non-CSV storage environment, replace the drive location with the location that is associated with the storage that is mounted to the new failover cluster. For example, if the location of the storage is now “Z:”, the Resource Paths in the script are:

    "Z:\HarddiskTempStorage0\fixed.vhd";"Z:\HarddiskTempStorage0\fixed_diff.vhd";"Z:\HarddiskTempStorage0\fixed1.vhd";"Z:\HarddiskTempStorage0\expanding.vhd"

  2. If you are migrating virtual machines from a non-CSV storage environment to a CSV storage environment, replace the original drive location with systemdrive/ClusterStorage. After you run the script, you should see the following output:

    >ImportVM.vbs /ImportDirectory:C:\ClusterStorage\Volume4\vm3Export\MyVM /ResourcePaths: "C:\ClusterStorage\Volume4\HarddiskTempStorage0\fixed.vhd"; "C:\ClusterStorage\Volume4:\HarddiskTempStorage0\fixed_diff.vhd"; "C:\ClusterStorage\Volume4\HarddiskTempStorage0\fixed1.vhd"; "C:\ClusterStorage\Volume4\HarddiskTempStorage0\expanding.vhd"