August 10, 2018
Cross-Platform Recovery Part 2: Export of Hyper-V VMs to VMware ESXi
The previous blog post introduced the new Cross-Platform Recovery feature that was released with NAKIVO Backup & Replication v7.5, making it possible to recover backed-up VMs across different virtual platforms. The new feature adds flexibility and allows you to extend the list of recovery scenarios in your disaster recovery plan. VM recovery from VMware backup to a Hyper-V host with NAKIVO Backup & Replication was explained with a walkthrough. In this follow-up, you can learn how to export a virtual disk from a Hyper-V backup to the VMware virtual disk format. This post also walks through configuration of the ESXi host with the VMware vSphere client to create a new VM for the exported virtual disks.
Exporting a Virtual Disk From Hyper-V Backup to VMware ESXi
Go to the web interface of your instance of NAKIVO Backup & Replication. Click Recover > Export Backups (as in the previous example detailed in part one) to launch the Backup Export Wizard for Cross-Platform Recovery. In the left panel, select a Hyper-V VM backup, and in the right panel, select a recovery point. Click Next to proceed.
Select the virtual disk(s) to be exported. Click Next.
Specify the export format, export location, and path, then input credentials for access. For the purposes of this walkthrough, the destination location is the same as it was in the previous example. Test the connection, then click the Export button. Wait until the backup export operation has finished writing the files of the virtual disk.
Two VMDK files are now visible in the directory specified for export. Their names look as follows: DiskName.VMDK and DiskName-flat.VMDK.
DiskName.VMDK is a virtual machine disk descriptor file that is created along with a virtual disk on VMware ESXi host. Files of this type are of small size. They can be opened and viewed with a text editor. The disk descriptor file contains the information about virtual disk parameters and virtual hardware version. It also includes a pointer to the DiskName-flat.VMDK file.
DiskName-flat.VMDK is the actual virtual disk file that contains all data that was written by the VM, including snapshots, etc. As such, these VMDK files are large. On the screenshot below, you can see the two files created during the backup export operation and compare their size.
Now let’s create a new virtual machine on the ESXi host and attach the exported virtual disk. This enables you to run a VM that was previously running in Hyper-V on a VMware ESXi host. In the example of this walkthrough, vCenter Server is used for centralized management of ESXi hosts within a datacenter. Open your browser and connect to vCenter with the vSphere web client. Select the ESXi host on which the VM should be created (10.10.10.74 is used here). Click Actions > New Virtual Machine.
The New Virtual Machine wizard is launched. Select Create a new virtual machine and click Next.
Select a name for the new VM and a folder where the VM should be placed (the folder can be a datacenter created in your vSphere infrastructure). In this walkthrough example, the name of the virtual machine is Ubuntu16Exported and the name of the datacenter is PMM. Click Next.
Select a compute resource. At this stage, you can select the ESXi host that should run the VM with its processor and memory resources. If you have a cluster, you can select a cluster. Click Next.
Now, select where to store the VM configuration and disk files. Storage can be locally attached to the host or shared via network (e.g. Network Attached Storage). Click Next to continue.
You should now select the compatibility settings for your new VM. If you have multiple ESXi hosts using different versions of ESXi hypervisor software, you can select the oldest version of ESXi used in your virtual environment; this allows you to migrate the VM you create between hosts. In this example, the VM created is compatible with ESXi 6.0 and later versions. Click Next to proceed.
Select a guest OS for the new VM. In this walkthrough example, a virtual machine with Linux Ubuntu 64-bit is used. Select the appropriate guest OS family and version from the drop-down menus. Click Next.
The next step is hardware customization. The wizard offers to create a new virtual disk for Ubuntu installation. As you already have virtual disk that you created with Backup Export for Cross-Platform Recovery, you can omit the creation of a new virtual disk by clicking the delete icon (see the screenshot below). The exported virtual disk with Ubuntu Linux can be added to the VM later, once it has been created. Click Next when you are ready to proceed.
Check the summary. Click Finish to create the VM if everything is satisfactory.
Now that you have created a new empty VM, you can upload the existing virtual disk for import to the VM. In the vSphere client, go to Datastores > Files. Select the directory of the recently created VM (Ubuntu16Exported in this case) on the datastore you specified. Click Upload Files, then select the two files (DiskName.VMDK and DiskName-flat.VMDK). Click Open and wait while the files are uploaded to the datastore. In the current example, the following two files are uploaded:
After successful upload of the two files, you see a single virtual disk file in the vSphere client. Don’t worry; the program automatically links the virtual disk descriptor file and data file. If you connected to the ESXi host via SSH and located the directory with the VM, you would see both files there (DiskName.VMDK and DiskName-flat.VMDK).
You can now add the copied virtual disk to the VM. Right-click the VM and select Edit Settings.
Click Add New Device > Existing Hard Disk.
A browsing window opens. In the left pane, select the datastore, then select the directory of the virtual machine to which the two files of the virtual disk have been copied (Ubuntu16Exported in this case). In the middle Contents section, select the virtual disk that you exported with NAKIVO Backup & Replication and copied to the VM directory. The following VMware virtual disk is selected in the current example:
In the right pane, you can see virtual disk information. Click OK.
The added virtual disk is now displayed in virtual machine settings. Click OK to finish configuring the virtual hardware.
The configured virtual machine is now ready to run on the VMware ESXi host. Select the VM and click Actions > Power > Power On.
The VM has been started successfully and the operating system is loaded (you can see this on the preview). Click Launch Web console to manage the VM in full-screen mode. You can now install VMware Tools for better performance and usability. To do so, click Install VMware Tools in the vSphere client; the virtual CD is then mounted to the VM. Open the terminal in the Linux guest OS, go to the directory with the VMware Tools installer on the virtual CD-ROM, and run the ./vmware-install.pl Perl script. Follow the wizard’s recommendations to complete the installation.
As you can see, the former Hyper-V VM is now successfully running on the VMware ESXi host thanks to NAKIVO Backup & Replication and the Cross-Platform Recovery feature.
This blog post, part 2 of a 3-part series on NAKIVO Backup & Replication’s Cross-Platform Recovery feature, has walked through the export of a VM with Linux Ubuntu guest OS from Hyper-V VM backup to VMware ESXi host. The virtual disk was exported from Hyper-V VM backup to VMDK format used by VMware. Then the virtual disk was attached to a new VMware VM configured in vSphere.
The upcoming third post in this series discusses how to recover a former Hyper-V VM on VMware Workstation or Oracle VirtualBox using a virtual disk exported from Hyper-V backup with Cross-Platform Recovery.