Bug 1622075 - [Blocked] Appliance failed import to engine due to incorrect OVF syntax generated by imagefactory
Summary: [Blocked] Appliance failed import to engine due to incorrect OVF syntax gener...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: rhvm-appliance
Version: 4.2.6
Hardware: All
OS: All
low
medium
Target Milestone: ---
: ---
Assignee: Lev Veyde
QA Contact: Petr Kubica
URL:
Whiteboard:
: 1571729 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-24 11:47 UTC by Pavol Brilla
Modified: 2022-08-26 19:05 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-03 16:07:58 UTC
oVirt Team: Node
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
ovf file for rhel-atomic-host (3.71 KB, text/plain)
2019-09-30 04:09 UTC, Joy Pu
no flags Details
new version of OVF format (8.47 KB, application/xml)
2019-10-11 11:28 UTC, Tomáš Golembiovský
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github redhat-imaging imagefactory issues 421 0 'None' open Generated OVF code has wrong syntax 2021-02-02 09:49:32 UTC
Github redhat-imaging imagefactory pull 422 0 'None' closed Added default namespace to ovf Envelope 2021-02-02 09:49:32 UTC
Red Hat Bugzilla 1466222 0 medium CLOSED oVirt appliance OVA file order doesn't conform to OVF specification 2021-02-22 00:41:40 UTC
Red Hat Knowledge Base (Solution) 3459921 0 None None None 2020-03-18 01:56:32 UTC

Internal Links: 1466222

Description Pavol Brilla 2018-08-24 11:47:03 UTC
Description of problem:
I am not able to import appliance OVA to 4.2 engine

Version-Release number of selected component (if applicable):
Software Version: 4.2.6.3-0.1.el7ev

How reproducible:
100%

Steps to Reproduce:
1. Compute > Virtual Machines > Import
2. Source: Virtual Appliance (OVA)
3. Path: /path/to/ova/on/your/host
4. Load
5. Will fail

Actual results:
Failed to load VM configuration from OVA file: /usr/share/ovirt-engine-appliance/rhvm-appliance-4.2-20180815.0.el7.ova


Expected results:
VM imported from OVA to engine succesfully.

Additional info:
VDSM error log:
2018-08-24 13:40:19,036+0200 ERROR (jsonrpc/4) [jsonrpc.JsonRpcServer] Internal server error (__init__:611)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/yajsonrpc/__init__.py", line 606, in _handle_request
    res = method(**params)
  File "/usr/lib/python2.7/site-packages/vdsm/rpc/Bridge.py", line 197, in _dynamicMethod
    result = fn(*methodArgs)
  File "<string>", line 2, in getExternalVmFromOva
  File "/usr/lib/python2.7/site-packages/vdsm/common/api.py", line 48, in method
    ret = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/vdsm/API.py", line 1480, in getExternalVmFromOva
    return v2v.get_ova_info(ova_path)
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 244, in get_ova_info
    _add_general_ovf_info(vm, root, ns, ova_path)
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 1381, in _add_general_ovf_info
    raise V2VError('Error parsing ovf information: no memory size')
V2VError: Error parsing ovf information: no memory size

Comment 1 Yuval Turgeman 2018-09-05 13:57:23 UTC
The code searches for 'ovf:Item' while the ovf contains 'Item':

>>> root.find('.//ovf:Item[rasd:ResourceType="%d"]/rasd:VirtualQuantity' % 4, ns)
>>> root.find('.//Item[rasd:ResourceType="%d"]/rasd:VirtualQuantity' % 4, ns).text
'16384'

Not sure what should be changed in this case, the ovf or the v2v code, any ideas ?

Comment 2 Jiri Belka 2018-09-10 12:41:51 UTC
(In reply to Yuval Turgeman from comment #1)
> The code searches for 'ovf:Item' while the ovf contains 'Item':
> 
> >>> root.find('.//ovf:Item[rasd:ResourceType="%d"]/rasd:VirtualQuantity' % 4, ns)
> >>> root.find('.//Item[rasd:ResourceType="%d"]/rasd:VirtualQuantity' % 4, ns).text
> '16384'
> 
> Not sure what should be changed in this case, the ovf or the v2v code, any
> ideas ?

No idea. We just reported it does not work.

Comment 3 Ryan Barry 2018-09-11 11:20:58 UTC
Tomas, any idea which one is correct?

Comment 4 Tomáš Golembiovský 2018-09-11 16:50:03 UTC
Your OVF is wrong. It specifies the ovf namespace only for the Envelope element but not for the other. Simplest fix would be to add default namespace to the root element (i.e. Envelope). Well... except that if you do that you should also check if Engine still reads the default_display_type and default_boot_sequence correctly.

Comment 7 Yuval Turgeman 2018-09-12 12:47:44 UTC
No idea, if they opened the bug now, I'm assuming it did... any idea, Pavol ?

Comment 8 Pavol Brilla 2018-09-18 06:34:10 UTC
I just got appliance blind testing during reorganization of team, I don't know if it worked before, I tested it, found it, so I reported it.

Comment 9 Sandro Bonazzola 2018-09-20 14:04:02 UTC
Yuval, correct me if I'm wrong, but OVF is generated automatically by imagefactory right?

Comment 10 Yuval Turgeman 2018-09-20 14:12:01 UTC
(In reply to Sandro Bonazzola from comment #9)
> Yuval, correct me if I'm wrong, but OVF is generated automatically by
> imagefactory right?

Yes, but it hasn't changed - we need to try and import an older appliance to see if it's something new

Comment 11 Sandro Bonazzola 2018-09-20 14:24:30 UTC
Reported here: https://github.com/redhat-imaging/imagefactory/issues/421

Comment 13 Sandro Bonazzola 2019-02-18 07:57:57 UTC
Moving to 4.3.2 not being identified as blocker for 4.3.1

Comment 20 Tomáš Golembiovský 2019-09-27 10:58:58 UTC
Can somebody attach the complete OVF, please?

Comment 22 Joy Pu 2019-09-30 04:09:19 UTC
Created attachment 1620936 [details]
ovf file for rhel-atomic-host

Comment 24 Tomáš Golembiovský 2019-10-11 11:27:14 UTC
I checked the attached OVF and I see it uses the old 0.9 draft version (which is obvious as that's the only format supported on export domain). To be able use UI import or API upload it has to be changed to conform to newer version of the OVF specification. See the attached example -- especially notice the change how various Sections are defined.

Comment 25 Tomáš Golembiovský 2019-10-11 11:28:38 UTC
Created attachment 1624711 [details]
new version of OVF format

Comment 27 Derrick Ornelas 2020-03-18 01:56:32 UTC
*** Bug 1571729 has been marked as a duplicate of this bug. ***

Comment 28 Sandro Bonazzola 2020-06-16 08:01:33 UTC
Can you please verify if this is now working for you?

Comment 29 Petr Kubica 2020-09-09 12:12:09 UTC
still same error:
2020-09-09 15:08:09,574+0300 INFO  (jsonrpc/2) [api.host] FINISH getExternalVmFromOva error=Error parsing ovf information: no memory siz
e from=::ffff:10.35.71.91,55398, flow_id=06c5c31a-f437-48bb-bcfe-56c1d450ff79 (api:52)
2020-09-09 15:08:09,574+0300 ERROR (jsonrpc/2) [jsonrpc.JsonRpcServer] Internal server error (__init__:350)
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/yajsonrpc/__init__.py", line 345, in _handle_request
    res = method(**params)
  File "/usr/lib/python3.6/site-packages/vdsm/rpc/Bridge.py", line 198, in _dynamicMethod
    result = fn(*methodArgs)
  File "<decorator-gen-462>", line 2, in getExternalVmFromOva
  File "/usr/lib/python3.6/site-packages/vdsm/common/api.py", line 50, in method
    ret = func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/vdsm/API.py", line 1501, in getExternalVmFromOva
    return v2v.get_ova_info(ova_path)
  File "/usr/lib/python3.6/site-packages/vdsm/v2v.py", line 241, in get_ova_info
    _add_general_ovf_info(vm, root, ns, ova_path)
  File "/usr/lib/python3.6/site-packages/vdsm/v2v.py", line 1381, in _add_general_ovf_info
    raise V2VError('Error parsing ovf information: no memory size')
vdsm.v2v.V2VError: Error parsing ovf information: no memory size

with: ovirt-engine-appliance-4.3-20200603.1.el7.ova
on: vdsm-api-4.40.28-1.el8ev.noarch

Comment 30 Sandro Bonazzola 2020-11-06 15:48:28 UTC
Is this still an issue with rhvm-appliance from 4.4?

Comment 31 Sandro Bonazzola 2020-11-09 08:52:50 UTC
Moved out to 4.4.5 due to capacity

Comment 32 Petr Kubica 2020-11-09 19:12:22 UTC
Shouldn't it be irrelevant? 
Or where should be the fix? On engine side or inside of uploaded image?

Comment 33 Sandro Bonazzola 2020-11-18 09:33:47 UTC
(In reply to Petr Kubica from comment #32)
> Shouldn't it be irrelevant? 
> Or where should be the fix? On engine side or inside of uploaded image?

Fix should be in the ova file content, so on rhvm-appliance side.

Comment 36 Sandro Bonazzola 2022-03-03 16:07:58 UTC
Closing due to capacity. If we'll have capacity we can consider reopening it.


Note You need to log in before you can comment on or make changes to this bug.