How to Migrate a Virtual Machine

Applies To: Virtual Machine Manager 2008, Virtual Machine Manager 2008 R2, Virtual Machine Manager 2008 R2 SP1

In Virtual Machine Manager (VMM) 2008, if you migrate a running virtual machine, VMM places the virtual machine into a saved state during the migration. You can migrate a virtual machine between hosts that are using the same virtualization software or from a Virtual Server host to a Hyper-V host. And, you can migrate a virtual machine’s files to a different storage location on the same host.

In VMM 2008 R2, for a Windows Server 2008 host cluster, you can migrate a running virtual machine between two hosts on the cluster with minimal service outage for the virtual machine. This is known as quick migration. And, for a Windows Server 2008 R2 host cluster, you can migrate a running virtual machine between two hosts on the cluster without any service outage for the virtual machine. This is known as live migration. For a Windows Server 2008 R2 host or a Storage VMotion-capable host, you can storage migrate a running virtual machine’s files to a different storage location on the same host with minimal or no service outage.

If you use a wizard to migrate a virtual machine to a host that is running Windows Server 2008 R2, and you use a network transfer, VMM 2008 R2 now gives you the option to specify separate storage locations for each virtual hard disk (.vhd) file for the virtual machine. This option is only available for network transfers.

While a running virtual machine is being migrated, the virtual machine remains online to service user requests. After the transfer of the virtual hard disk file is complete, the running virtual machine is placed into a saved state until the configuration file is transferred. After the configuration file transfer is complete, VMM automatically restores the original state of the virtual machine and will restart the virtual machine if it was running. The typical service outage experienced by the user is only a few seconds.

In Virtual Machines view, the following methods are available to migrate a deployed virtual machine to a different host:

  • Use the Migrate action. The Migrate Virtual Machine Wizard enables you to select a suitable host, specify the path that will store the virtual machine files, attach the virtual machine to any of the virtual networks that are found on the selected host, and, if a SAN transfer is available, to select a network transfer instead.

  • Use the Migrate storage action. In VMM 2008 R2, on a host that is running Windows Server 2008 R2, you can move the files for a virtual machine to a different storage location on the same host. For more information, see How to Migrate Storage of Virtual Machine Files.

  • Drag and drop the virtual machine onto a host. Through automatic placement, the virtual machine is placed on the most suitable volume on the host based on available space.

  • Drag and drop the virtual machine onto a host group. Through automatic placement, the virtual machine is placed on the most suitable host that is available in the host group based on the virtual machine's requirements and your host rating metrics, and is placed on the most suitable volume on the host based on available space.

Note

During automatic placement, the host rating process identifies the most suitable volume on each host. If no default virtual machine paths that are configured on the host are on the recommended volume, the host receives a zero host rating, and the virtual machine will not be migrated to that host. For more information, see Deploying and Migrating Virtual Machines (https://go.microsoft.com/fwlink/?LinkID=163255).

If a properly configured SAN is available, VMM automatically uses the SAN to make transfers. However, if you use the Migrate Virtual Machine Wizard to perform a transfer, you can override the SAN usage and make a local area network (LAN) transfer.

Important

If you migrate a virtual machine that is connected to SAN storage, the virtual machine will not be able to reconnect to the SAN unless the destination host also has access to that SAN. VMM is not able to detect if a virtual machine is connected to a SAN or if the destination host is connected to the same SAN, and therefore cannot provide a warning. You must ensure that the new host is configured to allow the virtual machine to reconnect to the SAN before you migrate the virtual machine.

Note

After you migrate a virtual machine to a host on a perimeter network, you cannot migrate the virtual machine back off the perimeter network.

Note

One method for converting a VMware virtual machine to a Hyper-V virtual machine is to migrate the virtual machine from its ESX Server host to a Hyper-V host. To successfully convert the virtual machine by using this method, the source ESX Server host must have OK status in VMM and the virtual machine must be turned off. Alternatively, you can perform a virtual-to-virtual (V2V) conversion on the virtual machine files to convert a VMware virtual machine to a Hyper-V virtual machine. For more information about the requirements for both conversion methods, see V2V: Converting Virtual Machines in VMM (https://go.microsoft.com/fwlink/?LinkID=128918).

Warning

If you change the permissions for a virtual machine through the file system, and then migrate the virtual machine through VMM, VMM will recreate the access control list (ACL). All changes made outside VMM will be lost.

If you attempt to migrate a virtual machine on a Hyper-V host soon after you have removed a checkpoint from the virtual machine, the migration might fail. If you attempt a migration before Hyper-V has finished deleting the checkpoint, the migration will fail and you must repair the virtual machine by using the Undo option. For more information about the Undo option, see How to Repair a Virtual Machine (https://go.microsoft.com/fwlink/?LinkID=163705). To avoid this issue, you can ensure that the checkpoint has been deleted or you can wait for Hyper-V to delete it for you.

To ensure that a checkpoint has been deleted

  1. In the VMM Administrator Console, in Virtual Machines view, click the virtual machine, and then click Stop in the Actions pane.

  2. On the host, open Hyper-V Manager. Click Start, point to Administrative Tools, and then click Hyper-V Manager.

  3. In the Status column, Merge in progress indicates that the checkpoint has not been deleted. Wait until this operation has completed before you migrate the virtual machine.

To migrate a virtual machine to a different host using a wizard

  1. In Virtual Machines view, navigate to the host on which the virtual machine is deployed in the navigation pane.

    Important

    Before you migrate a virtual machine from an ESX Server host to a Hyper-V host, ensure that the ESX Server host has OK status in VMM. If the host has OK (Limited) status, additional security configuration is required to enable file transfers to the Hyper-V host. You must provide credentials for the ESX Server host; in addition, if you are managing your VMware infrastructure in secure mode, a certificate and public key might be required. For detailed security requirements, see Configuring Security for a Managed VMware Environment in VMM (https://go.microsoft.com/fwlink/?LinkID=145051).

  2. In the results pane, select the virtual machine, and then click Migrate in the Actions pane.

    Important

    Before you migrate a virtual machine from an ESX Server host to a Hyper-V host, you must turn off the virtual machine.

  3. On the Select Host wizard page, select a host to deploy the virtual machine on. In the list of hosts, all available hosts are given a rating of 0–5 stars based on the host's suitability to host the current virtual machine. The ratings are recommendations. You can select any host that has the required disk space, even if the host has a zero host rating.

    Network optimization   In VMM 2008 R2, if a host has network optimization enabled, a green checkmark appears in the Network Optimization column. VMM 2008 R2 allows you to take advantage of network optimization capabilities that are available on Hyper-V hosts that are running Windows Server 2008 R2. For information about network optimization and the hardware that supports it, see the Windows Server 2008 R2 documentation. After a virtual machine is deployed, this feature is displayed only for virtual machines that are deployed on a host that is running Windows Server 2008 R2.

    Highly available virtual machines   By migrating a virtual machine that is not highly available to a host that is in a host cluster, you can make it a highly available virtual machine (HAVM). Similarly migrating a highly available virtual machine to a non-clustered host will make it non-highly available virtual machine. Because of the resulting change to the virtual machine’s highly available setting, either of these actions requires confirmation in the wizard.

    Live migration   When you migrate a running virtual machine within a cluster created in Windows Server 2008 R2 Hyper-V and managed by using VMM 2008 R2, VMM performs a live migration. With live migration, you can move running virtual machines from one Hyper-V physical host to another without any interruption of service or perceived service outage. If you have not upgraded to Windows Server 2008 R2, for migrations within a Windows Server 2008 cluster, VMM performs a quick migration, with a brief interruption of service and no loss of state that is in memory while the virtual machine is migrated. Live migrations also are performed between VMware hosts that are VMotion capable.

    Note

    For more information about factors that affect virtual machine placement in VMM, see How Virtual Machine Manager Rates Hosts (https://go.microsoft.com/fwlink/?LinkId=116302).

    1. To get additional information about the host, select the host, and view the tabs in the details area:

      Details — Indicates the status of the host, the operating system, and the type and status of virtualization software. Lists the virtual machines on the host.

      Rating Explanation — Lists the factors that resulted in a 0 star rating.

      SAN Explanation — Lists the factors that make a SAN transfer unavailable.

    2. To change the host rating criteria for the current virtual machine, click Customize Ratings. You can change the placement goal as well as the relative importance placed on the availability of CPU, memory, disk I/O capacity, and network capacity for the current virtual machine. For more information, see How to Customize Host Ratings for a Virtual Machine.

  4. On the Select Path wizard page:

    1. To specify a virtual machine path, click Browse, navigate to the folder in which you want to store the configuration files for the virtual machine, and then click OK.

      In VMM 2008 R2, if the target host is a Windows Server 2008 R2 Hyper-V host that is part of a failover cluster that has Cluster Shared Volumes (CSV) enabled, you can store the virtual machine on a CSV LUN that is already in use by other highly available virtual machines (HAVMs). With CSV, multiple HAVMs can share the same LUN, and migrating one HAVM does not affect others that are sharing the same LUN. VMM also supports multiple HAVMs per LUN for VMware environments configured with VMware VMFS LUNs.

    2. If you selected a path other than a default virtual machine path and would like to store other virtual machines on that path, select the Add this path to the list of host default paths check box to add the path to the default paths on the host. For information about configuring default virtual machine paths, see How to Set Placement Options for a Host.

      If you use a wizard to migrate a virtual machine to a host that is running Windows Server 2008 R2, and you use a network transfer, you have the option to specify separate storage locations for each virtual hard disk (.vhd) file for the virtual machine. By default, all .vhd files will be stored in the same location specified for the virtual machine.

    3. If SAN transfers are enabled for this deployment, the virtual machine by default is transferred to the host over the SAN. If you do not want to perform a SAN transfer, select the Transfer over the network even if a SAN transfer is available check box. If SAN transfers are not available for this deployment, the field is not available.

  5. On the Select Networks wizard page, modify the networks and attach them to None or to any of the virtual networks that are found on the selected host.

    Note

    Networks area will list each of the virtual network adapters that are currently attached to the virtual machine. Network adapters will default to None if you selected None in the hardware configuration or to the best matching virtual network according to the network matching rules.

  6. On the Summary wizard page, review your settings. To change settings, click Previous.

    To start the virtual machine after deploying it, select the Start the virtual machine immediately after deploying it to the host check box.

    Note

    Use the View Script button to display the Windows PowerShell - Virtual Machine Manager Command Shell cmdlets that will perform the conversion. All administrative tasks in Virtual Machine Manager can be performed at the command line or scripted. For more information, see Using the Windows PowerShell - VMM Command Shell.

  7. To begin deploying the virtual machine, click Move.

    To review the progress and results of the operation, display the Jobs window. The window is opened by default when the wizard closes. To view this window at any time, click the Jobs button on the console toolbar.

To migrate a virtual machine by using drag and drop

  1. In Virtual Machines view, navigate to the virtual machine's current host in the navigation pane.

  2. In the results pane, click the virtual machine and, holding down the mouse button, drag the virtual machine to either the host of choice, or the host group of choice, in the navigation pane.

  3. When you release the mouse button, the system attempts to migrate the virtual machine by using one of the following methods:

    • If you dragged the virtual machine to a host, the system evaluates the host's suitability for the virtual machine and attempts to migrate the virtual machine if the host is found suitable.

    • If you dragged the virtual machine to a host group, the system rates each host in the host group and attempts to migrate the virtual machine to the most suitable of those hosts. For the migration to succeed, a virtual machine path must be configured on the host for the recommended volume.

See Also

Concepts

How to Deploy a Virtual Machine

Other Resources

Deploying and Migrating Virtual Machines
How to Store a Virtual Machine in the Library