Created attachment 705586 [details] example.ovf Description of problem: Attempting to convert a RHEV OVF image of ManageIQ fails using virt-convert. Version-Release number of selected component (if applicable): * python-virtinst-0.600.3-2.fc18.noarch Steps to Reproduce: 1. Obtain ManageIQ EVM appliance OVF (hand wave) 2. Attempt to convert RHEV OVF into virt-image format > virt-convert --debug -i ovf -o virt-image master/vms/4d9cfc66-1ae5-4e7b-9b2a-39176d4e63b5/4d9cfc66-1ae5-4e7b-9b2a-39176d4e63b5.ovf Actual results: > [Tue, 05 Mar 2013 13:32:24 virt-convert 20422] ERROR (cli:439) Couldn't import file "master/vms/4d9cfc66-1ae5-4e7b-9b2a-39176d4e63b5/4d9cfc66-1ae5-4e7b-9b2a-39176d4e63b5.ovf": list index out of range > [Tue, 05 Mar 2013 13:32:24 virt-convert 20422] DEBUG (cli:442) > Traceback (most recent call last): > File "/usr/bin/virt-convert", line 185, in main > vmdef = inp.import_file(options.input_file) > File "/usr/lib/python2.7/site-packages/virtconv/parsers/ovf.py", line 300, in import_file > return _xml_wrapper(xml, ovf_parser._import_file) > File "/usr/lib/python2.7/site-packages/virtconv/parsers/ovf.py", line 131, in _xml_wrapper > result = func(ctx) > File "/usr/lib/python2.7/site-packages/virtconv/parsers/ovf.py", line 345, in _import_file > ens = xpath_nodes("/ovf:Envelope[1]")[0] > IndexError: list index out of range Expected results: Successful image conversion Additional info: * See attachment for .ovf file
I can reproduce this issue also.
the problem seems to be caused by the xpath query. If the "ovf" namespace is not registered, then xpath doesn't correctly perform the query. This line seems to fix the reported problem: ctx.xpathRegisterNs("ovf", "http://schemas.dmtf.org/ovf/envelope/1/") Using the attached file I now get: Traceback (most recent call last): File "virt-manager/virt-convert", line 176, in main vmdef = inp.import_file(options.input_file) File "virt-manager/virtconv/parsers/ovf.py", line 289, in import_file register_namespace=ovf_register_namespace) File "virt-manager/virtinst/util.py", line 300, in xml_parse_wrapper ret = parse_func(doc, ctx, *args, **kwargs) File "virt-manager/virtconv/parsers/ovf.py", line 426, in _import_file vm.validate() File "virt-manager/virtconv/vmcfg.py", line 69, in validate raise ValueError(_("VM name is not set")) ValueError: VM name is not set and it seems that the file is missing also other information. I have no familiarity with ovf, is it a valid ovf file?
If RHEV is generating it, presumably it's been successfully consumed by something else. So I think we can assume it's a valid ovf. virt-convert likely just needs to be extended.
After poking at it for a while, I'm pretty convinced that ovf output is bogus. It's not like any other ovf files I can find in the wild. It doesn't even reference real filesystem paths, just UUIDs, so there would be nothing for libvirt to actually start anyways. Closing as CANTFIX