Bug 1743543

Summary: extract_ova fails over nfs
Product: [oVirt] ovirt-engine Reporter: Michal Skrivanek <michal.skrivanek>
Component: BLL.VirtAssignee: Shmuel Melamud <smelamud>
Status: CLOSED CURRENTRELEASE QA Contact: Nisim Simsolo <nsimsolo>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.3.0CC: bugs, lsvaty, nsimsolo, smelamud
Target Milestone: ovirt-4.4.0Flags: pm-rhel: ovirt-4.4+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.4.0 gitb5b5c99ca2f Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-08-05 06:09:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1825638    
Bug Blocks:    

Description Michal Skrivanek 2019-08-20 08:11:48 UTC
This bug was initially created as a copy of Bug #1645229
Same issue, just with extract_ova

---


Description of problem:
1. create a vm
2. Stop the vm
3. Select the vm . and click "Export as OVA: from web-UI
4. Enter the target directory for the host as /tmp

Fails to create ova image

Engine creates a copy of the image in storage domain . As a process of creating ova, it fails to open the disk image which get created in storage doamin due to  permission issue. The image created by vdsm user. But the ansible playbook which opens the image uses root user.

Storage : NFS
Note: Export to Domain works fine

From Engine log
2018-10-26 12:11:36,657-04 ERROR
[org.ovirt.engine.core.bll.SerialChildCommandsExecutionCallback]
(EE-ManagedThreadFactory-engineScheduled-Thread-37) [484d3716] EngineException: ENGINE
(Failed with error ENGINE and code 5001):
org.ovirt.engine.core.common.errors.EngineException: EngineException: ENGINE (Failed with
error ENGINE and code 5001)
at
org.ovirt.engine.core.bll.exportimport.ExportOvaCommand.createOva(ExportOvaCommand.java:301)
[bll.jar:]
at
org.ovirt.engine.core.bll.exportimport.ExportOvaCommand.executeNextOperation(ExportOvaCommand.java:285)
[bll.jar:]
at
org.ovirt.engine.core.bll.exportimport.ExportOvaCommand.performNextOperation(ExportOvaCommand.java:277)
[bll.jar:]
at
org.ovirt.engine.core.bll.SerialChildCommandsExecutionCallback.childCommandsExecutionEnded(SerialChildCommandsExecutionCallback.java:32)
[bll.jar:]
at
org.ovirt.engine.core.bll.ChildCommandsCallbackBase.doPolling(ChildCommandsCallbackBase.java:68)
[bll.jar:]
at
org.ovirt.engine.core.bll.tasks.CommandCallbacksPoller.invokeCallbackMethodsImpl(CommandCallbacksPoller.java:146)
[bll.jar:]
at
org.ovirt.engine.core.bll.tasks.CommandCallbacksPoller.invokeCallbackMethods(CommandCallbacksPoller.java:107)
[bll.jar:]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[rt.jar:1.8.0_181]


From Ansible log:

Error message:
writing disk:
path=/rhev/data-center/mnt/ca-ovmstor101:_export_sanrathi_brml11g04-oVirt-nfs-01/aec73d1f-ea3d-4228-a151-a41b20b6b67b/images/7af3ed03-9be5-4c29-b1f2-2566a00671ba/f4a9a516-12b1-47ff-b2f9-e5d792669b3c
size=196624
Traceback (most recent call last):
File
"/root/.ansible/tmp/ansible-tmp-1540582852.05-258889562906077/pack_ova.py", line
96, in <module>
write_disks(ova_path, disks_info.split('+'))
File
"/root/.ansible/tmp/ansible-tmp-1540582852.05-258889562906077/pack_ova.py", line
79, in write_disks
write_disk(ova_path, disk_path, disk_size)
File
"/root/.ansible/tmp/ansible-tmp-1540582852.05-258889562906077/pack_ova.py", line
59, in write_disk
fd = os.open(disk_path, os.O_RDONLY | os.O_DIRECT)
OSError: [Errno 13] Permission denied:
'/rhev/data-center/mnt/ca-ovmstor101:_export_sanrathi_brml11g04-oVirt-nfs-01/aec73d1f-ea3d-4228-a151-a41b20b6b67b/images/7af3ed03-9be5-4c29-b1f2-2566a00671ba/f4a9a516-12b1-47ff-b2f9-e5d792669b3c'


1. File permission:
[root@ca-ovsx131 images]# ll
drwxr-xr-x. 2 vdsm kvm 5 Oct 26 13:40 7af3ed03-9be5-4c29-b1f2-2566a00671ba

[root@ca-ovsx131 images]# ll f83b2026-099d-4983-9130-fa999bd2a782/
total 1028
-rw-rw----. 1 vdsm kvm 1073741824 Oct 26 13:31 6eb8cd98-ec3f-47a4-908c-e17f45e6cf6a
-rw-rw----. 1 vdsm kvm 1048576 Oct 26 13:31 6eb8cd98-ec3f-47a4-908c-e17f45e6cf6a.lease
-rw-r--r--. 1 vdsm kvm 319 Oct 26 13:31 6eb8cd98-ec3f-47a4-908c-e17f45e6cf6a.meta


2.File Format:
bash-4.2$ qemu-img info
7af3ed03-9be5-4c29-b1f2-2566a00671ba/f4a9a516-12b1-47ff-b2f9-e5d792669b3c
image: 7af3ed03-9be5-4c29-b1f2-2566a00671ba/f4a9a516-12b1-47ff-b2f9-e5d792669b3c
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 259K
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false

Comment 2 Nisim Simsolo 2020-06-03 11:11:51 UTC
Verified:
ovirt-engine-4.4.1.1-0.5.el8ev
vdsm-4.40.17-1.el8ev.x86_64
libvirt-daemon-6.0.0-22.module+el8.2.1+6815+1c792dc8.x86_64
qemu-kvm-4.2.0-22.module+el8.2.1+6758+cb8d64c2.x86_64

Verification senario:
1. Export VM as OVA to host /tmp folder.
   Verify VM exported successfully.
2. Import OVA from host /tmp folder.
   Run VM and verify VM is running successfully.

Comment 3 Sandro Bonazzola 2020-08-05 06:09:58 UTC
This bugzilla is included in oVirt 4.4.0 release, published on May 20th 2020.

Since the problem described in this bug report should be
resolved in oVirt 4.4.0 release, it has been closed with a resolution of CURRENT RELEASE.

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