Created attachment 1275380 [details] scripts - upload and download, logs: engine, proxy, daemon, vdsm Description of problem: Unable to upload/download images using python sdk Version-Release number of selected component: engine: rhevm-4.1.2-0.1.el7.noarch ovirt-imageio-common-1.0.0-0.el7ev.noarch ovirt-imageio-proxy-1.0.0-0.el7ev.noarch ovirt-engine-sdk-python-3.6.9.1-1.el7ev.noarch python-ovirt-engine-sdk4-4.1.3-1.el7ev.x86_64 hosts: vdsm-4.19.11-1.el7ev.x86_64 ovirt-imageio-daemon-1.0.0-0.el7ev.noarch ovirt-imageio-common-1.0.0-0.el7ev.noarch python-sdk I was working with on a remote machine: ovirt-engine-sdk-python-4.1.3 How reproducible: 100% Steps to Reproduce: Using scripts: upload_disk.py / download_disk.py that are supplied with ovirt-engine-sdk-python-4.1.3 (under examples directory), try to upload / download disks. Actual results: Fails each time: For upload: [ngavrilo@dhcp-4-76 examples]$ ./upload_disk.py Traceback (most recent call last): File "./upload_disk.py", line 105, in <module> id=disk.id File "build/bdist.linux-x86_64/egg/ovirtsdk4/services.py", line 12194, in add File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 98, in _check_fault File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 71, in _raise_error ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Cannot ${action} Storage. Storage Domain doesn't exist.]". HTTP response code is 400. [ngavrilo@dhcp-4-76 examples]$ ./download_disk.py Traceback (most recent call last): File "./download_disk.py", line 70, in <module> direction=types.ImageTransferDirection.DOWNLOAD, File "build/bdist.linux-x86_64/egg/ovirtsdk4/services.py", line 12194, in add File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 98, in _check_fault File "build/bdist.linux-x86_64/egg/ovirtsdk4/service.py", line 71, in _raise_error ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Cannot ${action} Storage. Storage Domain doesn't exist.]". HTTP response code is 400. from engine.log: for upload: 2017-05-01 12:11:44,644+03 WARN [org.ovirt.engine.core.bll.storage.disk.AddDiskCommand] (DefaultQuartzScheduler4) [] VM is null - no unlocking 2017-05-01 12:11:46,641+03 WARN [org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand] (default task-8) [908cb225-694e-478f-9a35-f96e37cf8f4e] Validation of action 'TransferDiskImage' failed for user admin@internal-authz. Reasons: VAR__TYPE__STORAGE__DOMAIN,ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST 2017-05-01 12:11:46,643+03 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-8) [] Operation Failed: [Cannot ${action} Storage. Storage Domain doesn't exist.] for download: 2017-05-01 12:13:41,009+03 WARN [org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand] (default task-2) [c80391f6-5890-470c-a797-5a07da9dae9a] Validation of action 'TransferDiskImage' failed for user admin@internal-authz. Reasons: VAR__TYPE__STORAGE__DOMAIN,ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST 2017-05-01 12:13:41,011+03 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-2) [] Operation Failed: [Cannot ${action} Storage. Storage Domain doesn't exist.] Expected results: For the upload/download to work, in previous version these scripts used to work (now for some reason now they don't)
Maybe I'm being daft, but the script tries to upload a disk to a domain with the **name** "data". Do you have such a domain?
(In reply to Allon Mureinik from comment #1) > Maybe I'm being daft, but the script tries to upload a disk to a domain with > the **name** "data". Do you have such a domain? from the script upload_disk.py: disk = disks_service.add( disk=types.Disk( name='mydisk', description='My disk', format=types.DiskFormat.COW, provisioned_size=provisioned_size, initial_size=initial_size, storage_domains=[ types.StorageDomain( name='iscsi_0' <-- this is the storage domain name ) ] ) ) This is the disk creation part - which seems to work, it's the upload itself that fails. AFAIK, the upload stage requires the disk id to upload to (haven't seen any usage of storage domain name).
(In reply to Natalie Gavrielov from comment #2) > (In reply to Allon Mureinik from comment #1) > > Maybe I'm being daft, but the script tries to upload a disk to a domain with > > the **name** "data". Do you have such a domain? > > from the script upload_disk.py: > <snipped> I literally have no idea what I was looking at. Sorry for the noise.
This fix is included in the ovirt-engine-4.1.2.2 build, retargetting.
Verified using builds: rhevm-4.1.2.2-0.1.el7.noarch vdsm-4.19.14-1.el7ev.x86_64 ovirt-imageio-common-1.0.0-0.el7ev.noarch ovirt-imageio-proxy-1.0.0-0.el7ev.noarch ovirt-imageio-daemon-1.0.0-0.el7ev.noarch
*** Bug 1451716 has been marked as a duplicate of this bug. ***