Bug 1447023 - Unable to upload/download images using python sdk
Summary: Unable to upload/download images using python sdk
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.1.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.1.2
: 4.1.2.2
Assignee: Daniel Erez
QA Contact: Natalie Gavrielov
URL:
Whiteboard:
: 1451716 (view as bug list)
Depends On:
Blocks: 1414484 1432079 1432089
TreeView+ depends on / blocked
 
Reported: 2017-05-01 09:33 UTC by Natalie Gavrielov
Modified: 2017-05-23 08:20 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-05-23 08:20:20 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.1+


Attachments (Terms of Use)
scripts - upload and download, logs: engine, proxy, daemon, vdsm (1.31 MB, application/zip)
2017-05-01 09:33 UTC, Natalie Gavrielov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 76593 0 'None' MERGED core: TransferDiskImage validation - get storage domain id from disk 2020-04-26 10:08:02 UTC
oVirt gerrit 76651 0 'None' MERGED core: TransferDiskImage validation - get storage domain id from disk 2020-04-26 10:08:03 UTC

Description Natalie Gavrielov 2017-05-01 09:33:42 UTC
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)

Comment 1 Allon Mureinik 2017-05-04 14:25:54 UTC
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?

Comment 2 Natalie Gavrielov 2017-05-08 08:34:42 UTC
(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).

Comment 3 Allon Mureinik 2017-05-09 09:52:17 UTC
(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.

Comment 4 Allon Mureinik 2017-05-14 09:11:20 UTC
This fix is included in the ovirt-engine-4.1.2.2 build, retargetting.

Comment 5 Natalie Gavrielov 2017-05-14 15:49:30 UTC
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

Comment 6 Daniel Erez 2017-05-17 13:11:55 UTC
*** Bug 1451716 has been marked as a duplicate of this bug. ***


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