VMware Cloud Community
jklinect
Contributor
Contributor

Import of OVF/OVA Fails

Little background on my environment.

Existing cluster is a XenServer 6.0.2 with XenCenter 6.1. I've tried exporting VMs as OVA and OVF format with and without a manifest file.

New cluster is a VMware ESXi 5.1 base, with the VCSA 5.1 virtual appliance.

When I try to import (deploy) either the OVF or OVA files, I receive the following error:

Line 1: Could not parse the document: 'encoding specified in XML declaration is incorrect".

Not sure what I'm doing wrong. I've also tried using VMware converter and am getting errors on that as well which has been posted in the following forum post:

http://communities.vmware.com/thread/434498

14 Replies
nielse
Expert
Expert

Could you post the xml file for inspection?

@nielsengelen - http://foonet.be - VCP4/5
0 Kudos
lenzker
Enthusiast
Enthusiast

Afaik xenserver export to ovf doesn't work with an esxi import since the disk-type is not compatible, so the converter is probably the best way to go.

have you checked the solutions from this KB? http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100915...

VCP,VCAP-DCA,VCI -> https://twitter.com/lenzker -> http://vxpertise.net
0 Kudos
LennieDH
Enthusiast
Enthusiast

Hello, I've had a similar error exporting VMs from Citrix environment, this was due to "incorrect" XML format used by XenCenter in ova not recognized by VMware.

This was basically the procedure I followed to import my VM:

1)Exported OVF and VHD from Citrix XenCenter

2)Created a new VM in Oracle VirtualBox using as virtual disk the VHD disk exported above. (this step was performed on my desktop pc on which I installed VirtualBox)

3)Exported OVA from Oracle VirtualBox

4)Imported OVA as an Assembly in vSphere

Hope this could hel you!!

If you find this information useful please mark it as "Helpful" or "Correct".
0 Kudos
jklinect
Contributor
Contributor

Nielse,

I'm not sure where the actual XML file is located, but here is the clipboard copy of it.

<?xml version="1.0" encoding="utf-16"?><ovf:Envelope xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xenovf="http://schemas.citrix.com/ovf/envelope/1" xml:lang="en-US" xenovf:Name="Hive-Cacti" xenovf:id="2400a6fc-10ba-4aaf-8e2e-0a2655f96304" xenovf:version="1.0.0" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1"><ovf:References><ovf:File ovf:id="827b5bf4-1d5e-4b45-9300-99de4cf4318f" ovf:href="e71db2f6-691e-4b14-89ac-8b56b2365f57.vhd" ovf:size="107592286208" /></ovf:References><ovf:DiskSection><ovf:Info>Available Disks</ovf:Info><ovf:Disk xenovf:isBootable="true" ovf:diskId="827b5bf4-1d5e-4b45-9300-99de4cf4318f" ovf:fileRef="827b5bf4-1d5e-4b45-9300-99de4cf4318f" ovf:capacity="107374182400" ovf:format="http://www.microsoft.com/technet/virtualserver/downloads/vhdspec.mspx" /></ovf:DiskSection><ovf:NetworkSection><ovf:Info>Available Networks</ovf:Info><ovf:Network ovf:name="687225dd-5a8f-cb25-0bd4-180e0aea1d01"><ovf:Description>Network Adapter</ovf:Description></ovf:Network></ovf:NetworkSection><ovf:StartupSection><ovf:Info>Startup Options</ovf:Info><ovf:Item ovf:id="368de63f-0e8d-4255-8de4-9eabf67493d7" ovf:order="0" /></ovf:StartupSection><ovf:VirtualSystem ovf:id="368de63f-0e8d-4255-8de4-9eabf67493d7"><ovf:Info>XenOVF Generated</ovf:Info><ovf:Name>Hive-Cacti</ovf:Name><ovf:OperatingSystemSection ovf:id="1"><ovf:Info>Version 6.3</ovf:Info><ovf:Description>CentOS release 6.3 (Final)</ovf:Description></ovf:OperatingSystemSection><ovf:VirtualHardwareSection xenovf:Id="444801ac-47b9-4433-b05d-150b9f759164"><ovf:Info>Virtual Hardware Requirements: 2048 MB RAM; 1 CPU(s), 1 Disk(s), 1 Network(s)</ovf:Info><ovf:System><vssd:Caption>Xen Virtual Machine</vssd:Caption><vssd:ElementName>Hive-Cacti</vssd:ElementName><vssd:InstanceID>6fccc3e6-fcdb-4dbf-b967-8dcdaf60c60f</vssd:InstanceID><vssd:VirtualSystemIdentifier>f1ac93ae-fce0-425d-a1af-f238fc5faad6</vssd:VirtualSystemIdentifier><vssd:VirtualSystemType>xen-3.0-x64</vssd:VirtualSystemType></ovf:System><ovf:Item><rasd:AddressOnParent>0</rasd:AddressOnParent><rasd:AllocationUnits>Disk</rasd:AllocationUnits><rasd:AutomaticAllocation>true</rasd:AutomaticAllocation><rasd:Caption>Hard Disk Image</rasd:Caption><rasd:Connection>827b5bf4-1d5e-4b45-9300-99de4cf4318f,device=0</rasd:Connection><rasd:ConsumerVisibility>3</rasd:ConsumerVisibility><rasd:Description>Created by template provisioner</rasd:Description><rasd:ElementName>Hive-Cacti 0</rasd:ElementName><rasd:HostResource>ovf:/disk/827b5bf4-1d5e-4b45-9300-99de4cf4318f</rasd:HostResource><rasd:InstanceID>827b5bf4-1d5e-4b45-9300-99de4cf4318f</rasd:InstanceID><rasd:Limit>1</rasd:Limit><rasd:MappingBehavior>0</rasd:MappingBehavior><rasd:ResourceSubType>Virtual Hard Disk Image</rasd:ResourceSubType><rasd:ResourceType>19</rasd:ResourceType><rasd:VirtualQuantity>1</rasd:VirtualQuantity><rasd:Weight>100</rasd:Weight></ovf:Item><ovf:Item ovf:required="false"><rasd:AddressOnParent>3</rasd:AddressOnParent><rasd:AllocationUnits>DVD Drives</rasd:AllocationUnits><rasd:AutomaticAllocation>true</rasd:AutomaticAllocation><rasd:Caption>CD/DVD Drive</rasd:Caption><rasd:Connection>device=3</rasd:Connection><rasd:ConsumerVisibility>3</rasd:ConsumerVisibility><rasd:Description>Xen CD/DVD Drive Setting Data.</rasd:Description><rasd:ElementName>CD/DVD Drive</rasd:ElementName><rasd:InstanceID>39be4cf8-4c4d-6e0f-9eb5-a9e8b12bc0ef</rasd:InstanceID><rasd:Limit>1</rasd:Limit><rasd:MappingBehavior>0</rasd:MappingBehavior><rasd:ResourceType>16</rasd:ResourceType><rasd:VirtualQuantity>1</rasd:VirtualQuantity><rasd:Weight>0</rasd:Weight></ovf:Item><ovf:Item><rasd:Address>86:91:ea:06:d6:67</rasd:Address><rasd:AllocationUnits>Ports</rasd:AllocationUnits><rasd:AutomaticAllocation>true</rasd:AutomaticAllocation><rasd:Caption>Network Adapter</rasd:Caption><rasd:Connection>687225dd-5a8f-cb25-0bd4-180e0aea1d01</rasd:Connection><rasd:ConsumerVisibility>3</rasd:ConsumerVisibility><rasd:Description>Network Adapter</rasd:Description><rasd:ElementName>VLAN2000 - Hive WebDev</rasd:ElementName><rasd:InstanceID>8a47af4f-4ce0-4b65-bce2-7e0366936929</rasd:InstanceID><rasd:Limit>1</rasd:Limit><rasd:MappingBehavior>0</rasd:MappingBehavior><rasd:ResourceType>10</rasd:ResourceType><rasd:VirtualQuantity>1</rasd:VirtualQuantity><rasd:Weight>0</rasd:Weight></ovf:Item><ovf:Item><rasd:AllocationUnits>Processor Cores</rasd:AllocationUnits><rasd:AutomaticAllocation>true</rasd:AutomaticAllocation><rasd:Caption>Processor</rasd:Caption><rasd:ConsumerVisibility>0</rasd:ConsumerVisibility><rasd:Description>Processor</rasd:Description><rasd:ElementName>Processor</rasd:ElementName><rasd:InstanceID>d3ccbedf-de35-4b39-92f1-cb45fe0b52ee</rasd:InstanceID><rasd:Limit>100000</rasd:Limit><rasd:MappingBehavior>0</rasd:MappingBehavior><rasd:ResourceType>3</rasd:ResourceType><rasd:VirtualQuantity>1</rasd:VirtualQuantity><rasd:Weight>100</rasd:Weight></ovf:Item><ovf:Item><rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits><rasd:AutomaticAllocation>true</rasd:AutomaticAllocation><rasd:Caption>Memory</rasd:Caption><rasd:ConsumerVisibility>2</rasd:ConsumerVisibility><rasd:Description>Memory Setting Data</rasd:Description><rasd:ElementName>Memory</rasd:ElementName><rasd:InstanceID>037a70cb-0f8a-473b-96c7-be1ce4e4ca5b</rasd:InstanceID><rasd:Limit>128</rasd:Limit><rasd:MappingBehavior>0</rasd:MappingBehavior><rasd:ResourceSubType>Machine Memory</rasd:ResourceSubType><rasd:ResourceType>4</rasd:ResourceType><rasd:VirtualQuantity>2048</rasd:VirtualQuantity><rasd:Weight>0</rasd:Weight></ovf:Item><xenovf:VirtualSystemOtherConfigurationData id="5b7e6e80-258b-4aab-bed7-88e9cbda44c9" Name="platform"><xenovf:Info>XenServer Platform Information</xenovf:Info><xenovf:Value>apic=true;nx=false;acpi=true;viridian=true;pae=true;</xenovf:Value></xenovf:VirtualSystemOtherConfigurationData><xenovf:VirtualSystemOtherConfigurationData id="ed195dc2-5f79-4ecd-ac8b-99342b3c0ea3" Name="PV_bootloader"><xenovf:Info>XenServer Specific Information</xenovf:Info><xenovf:Value>pygrub</xenovf:Value></xenovf:VirtualSystemOtherConfigurationData></ovf:VirtualHardwareSection></ovf:VirtualSystem></ovf:Envelope>

0 Kudos
jklinect
Contributor
Contributor

Lennie,

Thanks for the info, I will give this a try. My only concern is that this is a production webhost server and downtime must be limited. I'll let you know how testing goes.

--

Jon

0 Kudos
LennieDH
Enthusiast
Enthusiast

The fact this is in production could be a problem actually, because this method is a sort of  a "workaround"...if possible the VM should be tested after being imported in ESXi and before release it to production!

Anyway I've noticed that the problem encountered by importing Citrix-generated OVF in VMware is due to the encoding:

<?xml version="1.0" encoding="utf-16"?>

which should be

<?xml version="1.0" encoding="utf-32"?>

Regards.

If you find this information useful please mark it as "Helpful" or "Correct".
0 Kudos
jklinect
Contributor
Contributor

Lennie,

Thanks for the reply. I will give that a try and see what happens. I've actually got a couple linux servers I need to export, so I can try this on a different non-critical server to see what happens before taking the webhost offline again.

--

Jon

0 Kudos
jklinect
Contributor
Contributor

Lennie,

If I open the OVF using notepad to edit the line you mentioned and save, I get an error that it failed integrity check.

Is there an XML editor I can use to edit this so it doesn't fail integrity check?

--

Jon

LennieDH
Enthusiast
Enthusiast

Hello!

The last post was just informational, you were not supposed to manually edit the ovf file!!:smileysilly:

I explain myself better:

Export your VMs from Citrix, you should have an .ovf  and one or more .vhd files according to your VMs hard disk.

OVF files generated by Citrix cannot be imported by VMware due to different encoding (utf-16 vs. utf-32) so we need to create a brand new utf-32 ovf that points to the Citrix exported VMs hard disks.

Open Virtualbox and deploy a new VM.

Under hard disk -> Use Existent Virtual Hard Disk and as virtual hard disk select Citrix-exported .vhd file.

Then under "File" click "Export Appliance".

The export result is an ova file which contains the Citrix VM furtherly converted by VirtualBox.

I repeat this is a workaround...this worked for me, maybe there are simpler and smarter solutions to this but if you have no choice you should give it a try!

Hope this could help,

Regards.

If you find this information useful please mark it as "Helpful" or "Correct".
0 Kudos
continuum
Immortal
Immortal

all the valid ovfs that I have seen use
<?xml version="1.0" encoding="UTF-8"?>

this is a Centos-VM - that means a simple OVF-import will fail  - very likely the new VM needs a different kernel.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
jklinect
Contributor
Contributor

Lennie,

It almost works except during the import it spits out an error on line 25 about unsupported hardware family "virtualbox-2.2". Did you have a way to get aroudn this?

--

Jon

0 Kudos
LennieDH
Enthusiast
Enthusiast

Hello Jon,

where do you get that error? I suppose it happens when importing VM in ESXi after VirtualBox export, right??

I've not encountered that problem, anyway after a brief search it turned out it's a "common" issue, and it is suggested to edit the ovf file from

<VirtualSystemType>virtualbox2.2</VirtualSystemType>

to

<VirtualSystemType>vmx-06</VirtualSystemType>

and use VMware OVF Tool to convert the ovf file.

For OVF Tool: http://www.vmware.com/support/developer/ovf/ovf301/ovftool-301-userguide.pdf

page 34 "Converting an OVA to a VMX" I think could be useful.

Last step is mandatory due to the fact that directly importing modified ovf file in vSphere returns integrity check error so using OVF Tools I suppose this integrity check on modified ovf is not performed!!


Hope this could help!!

Regards.

If you find this information useful please mark it as "Helpful" or "Correct".
0 Kudos
sympatiko
Enthusiast
Enthusiast

Hi  Im having the same issue. Do I still need to install the OS or after I created before starting the VM I can already extract the ova? When I extract the ova file from xencenter I generated 2 .vhd file. Can I upload 2 vhd on virtualbox?

0 Kudos
gcsc
Enthusiast
Enthusiast

In my experience the Citrix OVF (Despite being an Open Virtualisation Format) isn't very compatible but you can import the vhd files into VMware Workstation and Oracle VirtualBox, but to get the disks into VMware ESXi you have to convert them to vmdks using something like WinImage. Even after you get the disks attached to the VM certain versions of Linux (Centos, Debian & Red Hat) struggle to start. 

0 Kudos