If your customers are familiar with VMware Workstation for virtualization, they’re probably used to doing things a certain way. For example, you only need to drag the file from its old location to the new one to migrate a virtual machine (VM) from one host to another. Replicating a server or desktop required a simple copy-and-paste operation, followed by changing a serial ID (SID) and desktop name.
Working with files in Hyper-V R2, however, isn’t as simple. There are additional steps required to obtain a fully functioning VM, and those steps aren’t very intuitive. Here are a couple of pointers to help customers navigate the Hyper-V R2 migration learning curve and avoid failures.
Always export and import VMs during Hyper-V R2 migration
When you’re relocating a Hyper-V R2 VM, you must export it from its original host and then import it into the new host. This two-step process will create a copy of the VM, so be sure you have enough disk space. To allocate disk space, go to the Hyper-V Manager console, right-click on a VM and then choose Export. The resulting screen will ask you to enter a location string to store the exported VM. Once you’ve exported the VM to a file server, right-click on the host and select Import Virtual Machine to import the new VM.
Be conscious of how you import virtual machines
There are three settings available for importing a VM to a new host. The first setting is used to move or restore the VM; the second setting is used only to copy the VM.
These selections are important because they determine whether the target Hyper-V host will use the same unique ID for the VM. Your inexperienced Hyper-V administrator customers may mistakenly think that the “unique ID” setting refers to the SID of the VM. However, the unique ID actually refers to the virtual machine’s ID; it has nothing to do with its SID, name or other internal characteristics. Hyper-V IDs must remain unique among hosts, so be sure to select Copy when you replicate the VM configuration.
The third setting is used to actually import a VM. In this setting, you can click on a check box labeled Duplicate all files so the same virtual machine can be imported again. When you do this, the system copies the VM’s files instead of moving them, allowing you to import the VM again in another location. You must select this option when you import template machines because re-exporting the VM is a time-consuming and frustrating process. Hyper-V R2’s import/export functionality can be tricky, so be extremely careful when deleting virtual hard disk (VHD) files.
Another problem can occur when differencing disks are used. A differencing disk is created based on another disk’s configuration. Creating a differencing disk means you create a permanent link between two disks. This link can never be severed.
Differencing disks can save disk space, but they can be a nightmare to use if you don’t keep track of the interconnections. Removing any parent disks that are associated with a differencing disk in the VM you’re trying to migrate can affect the export/import process.
A problem with Microsoft’s API for importing can also affect differencing disks and may result in the following import error message: A server error occurred while attempting to import the virtual machine. Import failed. Unable to find required file or folder <VHD name>. If this occurs, the Wadeware team suggests a fix that involves manipulating symbolic links to parent disks.
About the author
Greg Shields, MVP, vExpert, is a partner with Concentrated Technology. Get more of Greg's tips and tricks at www.concentratedtech.com.