Bug 1401848 - [z-stream clone - 4.0.7] Improve OVA import compatibility
Summary: [z-stream clone - 4.0.7] Improve OVA import compatibility
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.0.5
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ovirt-4.0.7
: ---
Assignee: Shahar Havivi
QA Contact: Nisim Simsolo
URL:
Whiteboard:
Depends On: 1401077
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-06 09:06 UTC by rhev-integ
Modified: 2020-01-17 16:22 UTC (History)
23 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, some OVF files that did not contain the VM Name tag caused a runtime error when importing. This update ensures that a default name is provided to the virtual machine by its OVA name.
Clone Of: 1401077
Environment:
Last Closed: 2017-03-16 15:30:16 UTC
oVirt Team: Virt
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2791931 0 None None None 2016-12-06 09:09:09 UTC
Red Hat Product Errata RHBA-2017:0542 0 normal SHIPPED_LIVE Red Hat Virtualization Manager 4.0.7 2017-03-16 19:25:04 UTC
oVirt gerrit 63517 0 master MERGED v2v: Support for ova exported from AWS 2020-02-07 22:00:33 UTC
oVirt gerrit 67869 0 None MERGED v2v: Support for ova exported from AWS 2020-02-07 22:00:33 UTC

Description rhev-integ 2016-12-06 09:06:32 UTC
+++ This bug is a downstream clone. The original bug is: +++
+++   bug 1401077 +++
======================================================================

+++ This bug is an upstream to downstream clone. The original bug is: +++
+++   bug 1371843 +++
======================================================================

For it's AWS Storage Gateway, Amazon provides it's VM gateway as an OVA. But ovirt can't import it using the "import virtual machines wizard", it fails with:

File "/usr/lib/python2.7/site-packages/yajsonrpc/__init__.py", line 544, in _handle_request
    res = method(**params)
  File "/usr/lib/python2.7/site-packages/vdsm/rpc/Bridge.py", line 195, in _dynamicMethod
    result = fn(*methodArgs)
  File "/usr/share/vdsm/API.py", line 1427, in getExternalVmFromOva
    return v2v.get_ova_info(ova_path)
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 197, in get_ova_info
    _add_general_ovf_info(vm, root, ns)
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 1060, in _add_general_ovf_info
    raise V2VError('Error parsing ovf information: no ovf:Name')
V2VError: Error parsing ovf information: no ovf:Name

You can test it, the VM is easy to get from:
https://eu-central-1.console.aws.amazon.com/storagegateway/create

(Originally by fabrice.bacchella)

(Originally by rhev-integ)

Comment 1 rhev-integ 2016-12-06 09:06:46 UTC
(In reply to Fabrice Bacchella from comment #0)
The current implementation of import OVAs is targeted for (and therefore tested with) OVAs that represent VMs exported from VMWare. This needs to be enhanced in order to support OVAs from other sources, like Amazon.

(Originally by Arik Hadas)

(Originally by rhev-integ)

Comment 4 rhev-integ 2016-12-06 09:07:02 UTC
OVA and OVF are open standard specified by the DMTF. Ever you support it whatever the source is coming from, or you have a very poor and incomplete implementation that happens to support random instances.

Don't try to nitpick about where it's coming from.

(Originally by fabrice.bacchella)

(Originally by rhev-integ)

Comment 5 rhev-integ 2016-12-06 09:07:11 UTC
(In reply to Fabrice Bacchella from comment #2)
> OVA and OVF are open standard specified by the DMTF. Ever you support it
> whatever the source is coming from, or you have a very poor and incomplete
> implementation that happens to support random instances.

This is the thing about it being an 'open' standard - everyone can write anything there (specifically, in the XML). And in fact, everyone does.
For example, VMware does not support our OVF - and no wonder - they have no idea what virtio is.

Same goes for Amazon.

> 
> Don't try to nitpick about where it's coming from.

Hope the above explains why it's not a nitpick.

(Originally by Yaniv Kaul)

(Originally by rhev-integ)

Comment 6 rhev-integ 2016-12-06 09:07:19 UTC
I'm not talking about hardware compatibility problem, like a vmdk versus other format, or a strange network card. The problem occurs when parsing the ovf xml.

The VM I tried to import is made specifically to run in vmware. So it's a "vmware compatible" ova. That make it's failure in ovirt even more strange.

(Originally by fabrice.bacchella)

(Originally by rhev-integ)

Comment 8 rhev-integ 2016-12-06 09:07:35 UTC
The OVF in the given OVA differs from OVFs that are generated by vSphere in:
1. There is no <Name> tag under <VirtualSystem>
2. The content of <rasd:HostResource> does not have the "ovf:" prefix
By adding these things, I managed to convert the given OVA.

Shahar,
1. this should be added to the code you have added in virt-v2v, right?
2. I guess we should not count on having the name of the VM inside the OVA. IMO the whole import dialog should behave differently for OVA files: when choosing OVA as a source, the user needs to specify the host and the path as today and if they are valid to go directly to the second dialog (and there we already verify that the VM name is not empty).

Fabrice, in the meantime, I suggest to extract the file (it is just a tar file), do the changes mentioned above manually and pack it again. Then you'll be able to import this VM (I also started the VM and got to the login screen).

(Originally by Arik Hadas)

(Originally by rhev-integ)

Comment 9 rhev-integ 2016-12-06 09:07:43 UTC
I made your requested modification to the OVF and it works. Thanks.

(Originally by fabrice.bacchella)

(Originally by rhev-integ)

Comment 10 rhev-integ 2016-12-06 09:07:51 UTC
We may need to patch vdsm and virt-v2v as well

(Originally by Shahar Havivi)

(Originally by rhev-integ)

Comment 13 rhev-integ 2016-12-06 09:08:12 UTC
I've also looked at the specification referenced by Shahar[1] to make sure whether we're just fixing our mess or somebody else's mess.

(In reply to Arik from comment #6)
> The OVF in the given OVA differs from OVFs that are generated by vSphere in:
> 1. There is no <Name> tag under <VirtualSystem>

The <Name> element is not mentioned anywhere (except examples), but looking at the schema file[2] it says it's optional.

> 2. The content of <rasd:HostResource> does not have the "ovf:" prefix

This is however a different story. Specification clearly states the value is either "ovf:/file/<id>" or "ovf:/disk/<id>". So it has to include the "ovf:" prefix. See Table 3 on page 21.


[1] http://www.dmtf.org/sites/default/files/standards/documents/DSP0243_2.1.0.pdf
[2] http://schemas.dmtf.org/ovf/envelope/2/dsp8023.xsd

(Originally by Tomas Golembiovsky)

(Originally by rhev-integ)

Comment 14 rhev-integ 2016-12-06 09:08:21 UTC
Patch send to virt-v2v:
https://www.redhat.com/archives/libguestfs/2016-September/msg00030.html

(Originally by Shahar Havivi)

(Originally by rhev-integ)

Comment 15 rhev-integ 2016-12-06 09:08:30 UTC
(In reply to Arik from comment #6)
> 2. I guess we should not count on having the name of the VM inside the OVA.
> IMO the whole import dialog should behave differently for OVA files: when
> choosing OVA as a source, the user needs to specify the host and the path as
> today and if they are valid to go directly to the second dialog (and there
> we already verify that the VM name is not empty).

You might want an optional name field, which would translate to
passing '-on name' to virt-v2v (or not).  With Shahar's patch,
every Amazon VM will be mapped to the same name "default".

(Originally by Richard Jones)

(Originally by rhev-integ)

Comment 16 rhev-integ 2016-12-06 09:08:38 UTC
> You might want an optional name field, which would translate to
> passing '-on name' to virt-v2v (or not).  With Shahar's patch,
> every Amazon VM will be mapped to the same name "default".
it is true only for conversion that will run directly virt-v2v.
vdsm is naming each vm with 'default' if the Name is not exists (current patch), and in oVirt engine you are able to name the VM regardless the ovf:name tag.

(Originally by Shahar Havivi)

(Originally by rhev-integ)

Comment 17 rhev-integ 2016-12-06 09:08:46 UTC
(In reply to rhev-integ from comment #0)
> +++ This bug is an upstream to downstream clone. The original bug is: +++
> +++   bug 1371843 +++
> ======================================================================

Whoever did this, next time please don't. It just messed up both original and this bug. Open a regular bug

(Originally by michal.skrivanek)

Comment 18 rhev-integ 2016-12-06 09:08:54 UTC
it is a trivial backport, let's do that in 4.0.7

(Originally by michal.skrivanek)

Comment 19 Francesco Romani 2016-12-14 08:27:42 UTC
unfortunately we add to revert until 4.0.6 is out. Will merge clone patch afterwards

Comment 20 Michal Skrivanek 2016-12-21 10:49:39 UTC
which other patch is required?

Comment 21 Francesco Romani 2017-01-02 16:29:32 UTC
(In reply to Michal Skrivanek from comment #20)
> which other patch is required?

We just need 4.0.6 to be released. After that is done, this patch will be merged, and will be in 4.0.7.

Comment 23 Nisim Simsolo 2017-01-29 12:51:57 UTC
Verification build:
rhevm-4.0.7-0.1.el7ev
qemu-kvm-rhev-2.6.0-28.el7_3.3.x86_64
vdsm-4.18.22-1.el7ev.x86_64
libvirt-client-2.0.0-10.el7_3.4.x86_64
sanlock-3.4.0-1.el7.x86_64
virt-v2v-1.32.7-3.el7_3.2.x86_64

Comment 25 errata-xmlrpc 2017-03-16 15:30:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0542.html


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