Restoring Thick-Provisioned VHD Exports to Hyper-V (Windows Server 2008 & Up)

Follow

Topic

This article describes the process for restoring a thick-provisioned VHD export to Hyper-V (Windows Server 2008 and up).

Environment

  • Datto SIRIS
  • Datto ALTO
  • Microsoft Hyper-V
  • Windows Server 2008
  • Windows Server 2008 R2
  • Windows Server 2012
  • Windows Server 2012 R2
  • Windows Server 2016

Description

Prerequisites

  • If any of the protected host's volumes are larger than 2 TB, you must perform a VHDx image export. VHD virtual disks do not support volumes larger than 2 TB.
  • Although image files on Datto appliances are dynamic, sparse or thin-provisioned, when a VHD image file is copied from the Datto device using copy-paste (or other tools that do not accommodate dynamic/sparse/thin provisioning), the VHD image file will be copied with thick provisioning.

When creating your virtual machine:

  • If both boot.vhd and C.vhd are present in the export, select boot.vhd as the first drive, and attach C.vhd as the secondary drive.
  • If only C.vhd is present, use C.vhd as the first drive.
  • For modern Windows installations, you must copy both the boot.vhd(x) and C.vhd(x) from the export to have a bootable restore.
  • For legacy Windows or Linux installations, you only need to copy the C.vhd(x) or sda1.vhd(x) from the export to have a bootable restore.
You will not see the option to attach multiple disks to a Hyper-V VM in the initial creation wizard. You must complete the wizard and then manually edit the VM settings to add additional disks. 

Procedure

Mounting the Export

1. Follow the steps in the Export Image article to obtain and copy the machine's recovery point to the hypervisor as a VHD or VHDx file. Make note of the Samba path shown.

2. On your Hyper-V enabled machine, open File Explorer and navigate to This PC.

3. Right-click any white space and select Add a network location. Click Next at the first Wizard page.

Figure 1: Add a network location

4. Select Choose a custom network location, and click Next.

Figure 2: Choose a custom network location

5. In the Internet or network address box, paste the Samba path you made note of in Step 1,  and click Next.

6. Enter a name for the share and click Next.

7. Click Open this network location and select Finish. Make note of its address. The next section of this article will use the new network location as the source folder.

Figure 3: Successful network location creation

8. Proceed to the Transferring the Disks section of this article to continue.

Transferring the Disks

1. Open the Virtual Hard Disks folder associated with your Hyper-V instance in a separate File Explorer instance.

  • You can find the folder path under the Actions → Hyper-V Settings menu in your Hyper-V manager environment.

2. Create a folder to restore your VHD(x) files to. This will become the destination folder.

3. Drag and drop the VHD(x) files from the source folder to the destination folder. Alternatively, you can right-click each VHD(x), select Copy, and then paste them in the destination folder.

Figure 4: Copying the disks

4. Once the transfer is complete, delete the network location you created in Mounting the Export.

Figure 5: Delete network location

Completing the Restore

Select a platform to continue:

NOTE: This article uses screenshots from Windows Server 2008 and 2012. Your user experience may vary slightly by platform.

Hyper-V Manager Server 2008

If the VM was not previously hosted in the Hyper-V Manager, you must create a new VM. Otherwise, replace the existing Hyper-V machine's virtual disks with the VHD(x) files copied from the image export by performing the following steps:

1. From the Hyper-V Manager click New → Virtual Machine. When the New Virtual Machine Wizard launches, click Next.

Hyper-V-Manager.pngFigure 6: Hyper-V Manager (click to enlarge)

2. At the Before You Begin page, click Next.

Figure 7: New Virtual Machine Wizard (click to enlarge)

3. Provide a name and location for the virtual machine, and then click Next.

4. Provide the amount of RAM to allocate the virtual machine. Click Next.

5. In the drop-down menu, select which NIC to use in the virtual machine. The default is not connected.

4NewVirtualMachineWizard-ConfigureNetworking.pngFigure 8: Configure networking (click to enlarge)

6. On the Connect Virtual Hard Disk page, select Use an existing virtual hard disk. Provide the path to the datastore where you copied the VHD file. Click Next.

5NewVirtualMachineWizard-ConnectVirtualHardDisk.pngFigure 9: Connect virtual hard disk (click to enlarge)

7. On the Summary page, confirm that all configuration settings are correct and click Finish.

8. Click Start.

fini.pngFigure 5: Start the virtual machine (click to enlarge)

Hyper-V Manager Server 2012 and Server 2016

If the VM was not previously hosted in the Hyper-V Manager, you must create a new VM. Otherwise, replace the existing Hyper-V machine's virtual disks with the VHD files copied from the image export by performing the following steps:

1. From the Hyper-V Manager click New Virtual Machine. When the New Virtual Machine Wizard launches, click Next.

1BuildVHDIntoHyper-V.pngFigure 10: Hyper-V Manager (click to enlarge)

2. Provide a name & location for the virtual machine, and then click Next.

3. Provide the amount of RAM to allocate the virtual machine. Click Next.

4. Specify the VM Generation.

Generation 1: Provides the same virtual hardware to the virtual machine as previous versions of Hyper-V. Any virtual machine over 2.2 TB must use a Generation 2 (UEFI) template.

Generation 2: Provides support for features such as Secure Boot, SCSI boot, and PXE boot using a standard network adapter. Can only use UEFI; BIOS is unsupported. Guest operating systems must be running at least Windows Server 2012 or 64-bit versions of Windows 8.

Once a virtual machine has been created, you cannot change its generation.

Figure 11: New Virtual Machine Wizard, Server 2012/2016 (click to enlarge)

5. In the drop-down menu, select which NIC to use in the virtual machine. The default is none.

4NewVirtualMachineWizard-NIC.pngFigure 12: Server 2012/2016, configure networking (click to enlarge)

6. On the Connect Virtual Hard Disk page, select Use an existing virtual hard disk. Provide the path to the datastore where the VHD file was copied in the previous section, and then click Next.

vmw4.pngFigure 13: Connect Virtual Hard Disk, Server 2012/2016 (click to enlarge)

7. On the Summary page, confirm all configuration settings are correct and click Finish.

8. Click Start to launch the virtual machine.

7-Fini.pngFigure 14: Launch a virtual machine, Server 2012/2016 (click to enlarge) 

Troubleshooting

Index

Logon failure: the user has not been granted the requested logon type at this computer.

You may encounter this error message when importing a VM into Hyper-V, as shown below:

Figure 15: Failed to add virtual hard disk (click to enlarge)

This Windows error can occur if the VM's special identity is missing the Log on as a Service permission on the Hyper-V host (possibly as a result of a failed group policy refresh). To resolve this issue, follow the troubleshooting steps provided by Microsoft in Starting or Live Migrating Hyper-V virtual machines may fail with error 0x80070569 on Windows Server 2012-based computers.

Thin Provisioning Unavailable

Microsoft does not currently provide tools to transfer VHD files to Hyper-V with sparse/thin/dynamic provisioning. This requires converting the disks from a live VM using Microsoft Virtual Machine Converter, described here. The converter is available for download here.

Mouse and networking do not work in the VM after restore

This can happen when the virtual machine is unable to reach the Hyper-V Integration Services on the Hyper-V host. To resolve the issue:

  1. Make sure that the Hyper-V Integration Services are enabled on the host.
    Log into the affected VM and use the keyboard to access the Windows Device Manager
  2. Press the Windows key + R to invoke the Run dialog box, type devmgmt.msc and press Enter.
  3. In the Device Manager window, scroll down to System.
    Find the Microsoft Hyper-V Virtual Machine Bus device. There may be a yellow exclamation mark next to it.
  4. Press Enter to open the Device Information window, then press Tab until you see an outline on one of the tabs across the top of the window.
  5. Use the keyboard arrows to select the Driver tab.
  6. Press Tab until the Update Driver button is highlighted. Press Space to click the button.
  7. Press Tab until the option for Browse my computer for driver software is highlighted.
  8. Press Space to select it.
  9. Press Tab until the Let me pick from a list of device drivers on my computer option is highlighted. Press Space to select it.
  10. The Select the device driver you want to install for this hardware screen will appear. Make sure that the Show compatible hardware check box is selected. You should see Microsoft Hyper-V Virtual Machine Bus listed in the Model box.
  11. Press Tab until you have highlighted the Microsoft Hyper-V Virtual Machine Bus driver, and then press Enter.
  12. The software will install. The screen may flicker during mouse and networking driver installation.
  13. After the software installs, the mouse should be functional. Check Hyper-V Manager to confirm that the network adapter is connected. Enter the IP address of the VM if it is set to static.
  14. Check the Services control panel to make sure that the Hyper-V Integration Services are running.

Additional Resources


Was this article helpful?

2 out of 2 found this helpful

You must sign in before voting on this article.

Want to talk about it? Head on over to our Community Forum!