Import a Virtual Machine running in the Oracle Virtual Box to VMware ESXi 5.1

This blog post is to import a Virtual Machine running in the Oracle Virtual Box to VMware ESXi 5.1, with the articles available online none worked in my case. So thought of sharing my solution with which I successfully imported and powered ON the virtual machine.
Customer Requirements:
1) Import the OVA Virtual Machine to ESXi, where OVA is of 500GB. 
2) Once imported Upgrade the CPU and Memory 
3) And also Extend the VMDK from 500 GB to 1 TB
Solutions I tried which didn’t worked for me: 
1) Downloaded the ovftool from the VMware Website at the following link: 

https://my.vmware.com/web/vmware/details?productId=352&downloadGroup=OVFTOOL350 
2) Installed this tool onto one of my vCenter Server and also copied the Oracle Virtual Box OVA file that I received onto one of the share drives and started to convert the file using the following command with –lax option and without –lax option.

ovftool.exe –lax C:\OracleOVA\VM-A.ova C:\OracleOVA\VM-A.ovf
Which resulted with the following error message:
-Line 2: Incorrect namespace ‘http://schemas.dmtf.org/ofg/envelope/2’ found completed with errors

So this ovftool has not worked in my case. So before we deep dive into the solution that worked for me, let’s try to understand what’s an OVA file is.

What is OVA File?
OVA-Open Virtual Appliance is a tar archive of OVF and VMDK files, you can use tar command to extract its files in Linux or use 7zip to extract the files in Windows. Once you extract these files, you will have the files needed (.OVF and VMDK). 

This is what My Solution was to import the VM:

1) Extracted the OVA file using the 7-ZIP, where I got both the OVF File and the .VMDK file.
2) Tried to deploy the Virtual Machine using the files OVF & vmdk, No luck received the same error:
-Line 2: Incorrect namespace ‘http://schemas.dmtf.org/ofg/envelope/2’ found completed with errors
3) So I have exported the VMDK file to one of the Datastores.
4)  Now, I logged into one of the ESX servers, where this Datastore is accessible and then tried to clone the VMDK file using the vmkfstools, this took a while to clone the vmdk and it was completed without any errors.
vmkfstools –i /vmfs/volumes/Datastore-a/Oracle-OVA.vmdk /vmfs/volumes/Datastore-a/VMware-VMDK.vmdk
5) When the conversion was completed, I see a big difference in the original VMDK file I received to the Cloned VMDK, check the following screen-shot.

As you can see from the Above screenshot:

The 251,524,100 Size vmdk is from the VirtualBox OVA file after exporting to Datastore.
The 422,212,800 is the cloned copy of the Same VMDK, after converting it using the vmkfstools. 

6) I created a new Virtual Machine with the customer requirements (Windows2008R2 VM/CPU/Memory/Network) and attached the existing VMDK file that I cloned.
7) Now, this has let me Powered ON the virtual Machine successfully.
8) Install the VMware Tools in the Virtual Machine and reboot the server.
9) Now its time to work on extending the virtual machine. When I right click on the Edit settings for the virtual machine I noticed that it was a IDE hard drive. So you can’t be able to extend the IDE Hard drives directly.
10) So it’s time to convert the ide hard drive to the SCSI. Go through the following KB article.
Converting a virtual IDE disk to a virtual SCSI disk (1016192)
Once the disk has been converted to SCSI, I was successfully be able to extend the VMDK to 1 TB.
 

That’s it.. With that I was successfully be able to import the Oracle Virtual Box VM in to VMware ESXi.

Leave a Reply