Bug 1833851 - [4.4 Beta] Cannot export VM as OVA
Summary: [4.4 Beta] Cannot export VM as OVA
Keywords:
Status: CLOSED DUPLICATE of bug 1825638
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.4.0
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact: meital avital
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-11 02:19 UTC by Germano Veit Michel
Modified: 2020-05-12 00:45 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-11 08:24:45 UTC
oVirt Team: Virt
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Germano Veit Michel 2020-05-11 02:19:36 UTC
Description of problem:

Exporting VM as OVA fails when writing the disk headers.
Seems to be related to finding the index, with a substring search that does not exist: "disk_info.index('::')"

2020-05-11 12:10:49 AEST - fatal: [host2.kvm]: FAILED! => {"changed": true, "msg": "non-zero return code", "rc": 1, "stderr": "Shared connection to host2.kvm closed.\r\n", "stderr_lines": ["Shared connection to host2.kvm closed."], "stdout": "writing ovf: <?xml version=1.0 encoding=UTF-8?><ovf:Envelope xmlns:ovf=http://schemas.dmtf.org/ovf/envelope/1 xmlns:rasd=http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData xmlns:vssd=http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns=http://schemas.dmtf.org/ovf/envelope/1 xmlns:ovirt=http://www.ovirt.org/ovf><References><File ovf:href=945f7e31-54a7-46e9-9d4c-828c03d3e189 ovf:id=945f7e31-54a7-46e9-9d4c-828c03d3e189 ovf:size=1310720></File></References><NetworkSection><Info>List of networks</Info></NetworkSection><DiskSection><Info>List of Virtual Disks</Info><Disk ovf:diskId=9f58df91-9f05-42f0-9f17-25322a06f487 ovf:capacity=2 ovf:capacityAllocationUnits=byte\r\nTraceback (most recent call last):\r\n  File \"/root/.ansible/tmp/ansible-tmp-1589163043.172344-70162732857194/pack_ova.py\", line 99, in <module>\r\n    write_disk_headers(ova_file, disks_info.split('+'))\r\n  File \"/root/.ansible/tmp/ansible-tmp-1589163043.172344-70162732857194/pack_ova.py\", line 71, in write_disk_headers\r\n    idx = disk_info.index('::')\r\nValueError: substring not found\r\n", "stdout_lines": ["writing ovf: <?xml version=1.0 encoding=UTF-8?><ovf:Envelope xmlns:ovf=http://schemas.dmtf.org/ovf/envelope/1 xmlns:rasd=http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData xmlns:vssd=http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns=http://schemas.dmtf.org/ovf/envelope/1 xmlns:ovirt=http://www.ovirt.org/ovf><References><File ovf:href=945f7e31-54a7-46e9-9d4c-828c03d3e189 ovf:id=945f7e31-54a7-46e9-9d4c-828c03d3e189 ovf:size=1310720></File></References><NetworkSection><Info>List of networks</Info></NetworkSection><DiskSection><Info>List of Virtual Disks</Info><Disk ovf:diskId=9f58df91-9f05-42f0-9f17-25322a06f487 ovf:capacity=2 ovf:capacityAllocationUnits=byte", "Traceback (most recent call last):", "  File \"/root/.ansible/tmp/ansible-tmp-1589163043.172344-70162732857194/pack_ova.py\", line 99, in <module>", "    write_disk_headers(ova_file, disks_info.split('+'))", "  File \"/root/.ansible/tmp/ansible-tmp-1589163043.172344-70162732857194/pack_ova.py\", line 71, in write_disk_headers", "    idx = disk_info.index('::')", "ValueError: substring not found"]}

Version-Release number of selected component (if applicable):
rhvm-4.4.0-0.33.master.el8ev.noarch
ansible-2.9.6-1.el8ae.noarch
vdsm-4.40.13-1.el8ev.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create VM with single disk
2. Export VM as OVA

Actual results:
Fail

Expected results:
Success

Comment 2 Germano Veit Michel 2020-05-11 02:23:29 UTC
Seems to be here in pack_ova.py

def write_disk_headers(ova_file, disks_info):
    for disk_info in disks_info:
        # disk_info is of the following structure: <full path>::<size in bytes>
        idx = disk_info.index('::')
        disk_path = disk_info[:idx]
        disk_size = int(disk_info[idx+2:])
        print("skipping disk: path=%s size=%d" % (disk_path, disk_size))
        disk_name = os.path.basename(disk_path)
        tar_info = create_tar_info(disk_name, disk_size)
        # write tar info
        ova_file.write(tar_info.tobuf())
        path_to_offset[disk_path] = str(ova_file.tell())
        ova_file.seek(disk_size, 1)
    os.fsync(ova_file.fileno())

Comment 3 Liran Rotenberg 2020-05-11 08:24:45 UTC
Hi Germano,
This bug is a duplicate of BZ 1825638.
Please note that the main reason of failing is the ansible-runner service.

*** This bug has been marked as a duplicate of bug 1825638 ***

Comment 4 Germano Veit Michel 2020-05-12 00:45:29 UTC
(In reply to Liran Rotenberg from comment #3)
> Hi Germano,
> This bug is a duplicate of BZ 1825638.
> Please note that the main reason of failing is the ansible-runner service.
> 
> *** This bug has been marked as a duplicate of bug 1825638 ***

Sorry for raising a DUP, I did search for those strings :(


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