SIRIS, ALTO, and NAS: Restoring Thin-Provisioned VHD Exports to Microsoft Hyper-V

Follow

Topic

This article describes the process for attaching a VHD export to a Windows host as a mounted volume and exporting its data to a thin-provisioned Microsoft Hyper-V virtual drive.

To restore a VHD to Microsoft Hyper-V with thick provisioning, see Restoring Thick-Provisioned VHD Exports to Hyper-V.

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
  • Windows Server 2019

Description

This article provides two methods for restoring thin-provisioned VHD exports. The Alternate method listed second is not compatible with Microsoft Windows 2019, but we have included it as an alternative that you can use with other Windows versions if desired.

During this process, you will mount a restore, create a new, dynamically-allocated virtual volume in Hyper-V, and then copy the contents of the exported VHD to the new volume.

NOTE: This article uses screenshots from Windows Server 2008. Your user experience may vary slightly on other platforms.

Follow the steps outlined below.

1. Mount an image export on your Datto device by following the steps in the Exporting to a Network Share section of the Export Image article. Make a note of the CIFS/Samba VHD Share path your appliance provides once the restore is mounted.

2. Launch Hyper-V Manager from Start → Administrative Tools → Hyper-V Manager.

3. From Hyper-V Manager, click Action → New → Hard Disk.

figure1.pngFigure 1: New Hard Disk (click to enlarge)

4. If you see a Before You Begin dialog, click Next.

5. Select the destination disk format and then click Next. 

figure2.pngFigure 2: Choose Disk Format (click to enlarge)

If you are unsure whether you should create a VHD or VHDX Image Export, refer to this Microsoft article (external link) for OS compatibility.

6. Choose the destination Disk Type, and then click Next. 

figure3.pngFigure 3: Choose Disk Type (click to enlarge)

7. Specify a name for the virtual disk and the location to save it to, and then click Next. 

figure4.pngFigure 4: Specify Name and Location (click to enlarge)

8. Select the disk or disks to copy by clicking Copy the contents of the specified virtual hard disk and browsing to the CIFS/Samba VHD Share path your appliance provided in step 1, then select the image file. You will repeat these steps for all volumes that you need to restore. 

figure5.pngFigure 5: Select the specified virtual hard disk (click to enlarge) 

9. Review the summary to ensure that the virtual hard disk is configured correctly. When you are ready to proceed with disk creation, click Finish.

Figure6.pngFigure 6: Summary (click to enlarge)

10. A progress bar showing the status of the transfer will appear.

figure7.pngFigure 7: Creating the new virtual hard disk (click to enlarge)

 Alternate method

This alternate method will not work on Server2019 hosts and could result in Incorrect function (0xc8007001) errors on Windows 2019 systems.

Index

Part 1: Attaching the Volume as a Logical Drive

1. Before proceeding further, mount an image export on your Datto device by following the steps in the Exporting to a Network Share section of the Export Image article. Make a note of the CIFS/Samba VHD Share path your appliance provides once the restore is mounted.

2. Launch Disk Management on your Hyper-V-enabled Windows machine.

Figure 8: Launching Disk Management (click to enlarge)

3. Click Action → Attach VHD.

Figure 9: Attach VHD (click to enlarge)

4. At the Attach Virtual Hard Disk prompt, select Browse.

Figure 10: Attach Virtual Hard Disk (click to enlarge)

5. In the Location field, enter the CIFS/Samba VHD Share you obtained in Step 1. Then, click Open.

6. When the share opens, select the hard disk image, and click Open.

Figure 11: Selecting a hard disk image (click to enlarge)

If boot.vhd and C.vhd are both present, 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.

NOTE: For Linux systems, C.vhd will be sda1.vhd.

There are two reasons to add a boot and a C volume:

  • For devices where UEFI is unsupported, adding a boot and C:\ volume is necessary to make GPT-formatted OS volumes readable.

  • Adding both volumes fixes virtualization failures for some MBR / BIOS agents. While a production Windows machine can still boot from its System Reserved partition even if its NTFS bootstrap code has corruption, virtualizations do not have this ability unless both the boot and C volumes are present.

7. At the Attach Virtual Hard Disk prompt, check the Read-only box, and click OK to mount the image.

boot2.jpgFigure 12: Attach Virtual Hard Disk (click to enlarge)

8. The VHD will mount as a volume in Windows.

figure13.pngFigure 13: VHD attached as Windows volume (click to enlarge)

9. To recover files from the virtual disk with their permissions intact, use Robocopy or Richcopy

10. To import the disk image into Hyper-V, see the next section of this article.

Part 2: Importing the Volume into Hyper-V Manager

1. Launch Hyper-V Manager from Start → Administrative Tools → Hyper-V Manager.

2. From Hyper-V Manager, click Action → New Hard Disk.

Figure 14: VHD attached as Windows volume (click to enlarge)

3. If you see a Before You Begin dialog, click Next.

4. Select the destination Disk Format, and then click Next.

Figure 15: Choose Disk Format (click to enlarge)

5. Choose the destination Disk Type, and then click Next.

Figure 16: Choose Disk Format (click to enlarge)

6. Specify a name for the virtual disk and the location to save it to, and then click Next.

Figure 17: Specify Name and Location (click to enlarge)

7. Select the disk or disks to copy by clicking Copy the contents of the specified physical disk and selecting the PHYSICALDRIVE value that is the same disk number as the VHD that is mounted. Then, click Next. Repeat this step for all disks involved in the restoration.

Figure 18: Disk number of mounted VHD (click to enlarge)

Figure 19:  Physical Hard Disk path (click to enlarge)

8. Review the summary to ensure that the virtual hard disk is configured correctly. When you are ready to proceed with disk creation, click Finish.

Figure 20: Summary (click to enlarge)

9. A progress bar showing the status of the transfer will appear.

Figure 21: Creating the new virtual hard disk (click to enlarge)

10. After the transfer has completed, detach the VHD from Disk Management, as shown in Figure 14.

Figure 22: Detach VHD (click to enlarge)

Part 3: Finalizing the Restore

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

2. If the Before You Begin page pops up, click Next.

3. Provide a name and (optionally) a storage location for the virtual machine, and then click Next.

Figure 23: Specify Name and Location (click to enlarge)

4. Specify the Generation of the VM. If you are using Hyper-V Manager 2008 or earlier, skip this step. Your Hyper-V Manager environment does not support Generation 2 virtual machines.

  • Generation 1 provides the same virtual hardware to the virtual machine as previous versions of Hyper-V. Any virtual machine over 2 TB must use a Generation 2 template.
    • Generation 1 VMs:
      • Can use VHD and VHDx disk formats
      • Only support the MBR boot type

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

5. Provide the amount of RAM to allocate the virtual machine. Then, click Next.

6. Select the NIC to use in the virtual machine. The default value is Not Connected (Hyper-V Manager 2008 or earlier) or None (Hyper-V Manager 2012).

7. 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(x), and then click Next. 

NOTE: Be sure to attach boot.vhd(x) first. 

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

Figure 24: Summary (click to enlarge)

9. In the Virtual Machines pane, right-click the VM, and then click Settings.

10. Click the storage controller to which you attached boot.vhd(x). Then, click Hard Drive → Add.

Figure 25: Hard Drive  (click to enlarge)

11. Select Virtual hard disk if it is not already selected. Browse to the location of your C.vhd(x) (or sda1.vhd, on Linux systems), select it, and click Apply. Repeat this step for each additional disk that you need to attach.

Figure 26: Browsing to and selecting a virtual hard disk (click to enlarge)

12. When you finish configuring the virtual machine's settings, click OK, right-click the VM, and click Start.

  • If the VM boots, the restore is complete.
  • If the VM fails to boot:
    • Collect and research any errors thrown, if applicable
    • Ensure that the VM uses the right Generation and disk format for its boot type. Remember: MBR = Generation 1, GPT = Generation 2.
    • Contact Datto Technical Support if you continue to experience bootability issues.

Figure 27: Starting the VM (click to enlarge)

Additional Resources


Was this article helpful?

4 out of 7 found this helpful

You must sign in before voting on this article.

Want to talk about it? Have a feature request?

Head on over to our Datto Community Forum or the Datto Community Online.

For more Business Management resources, see the Datto RMM Online Help and the Autotask PSA Online Help .

Still have questions? Get live help.

Datto Homepage