Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1415808 - Cannot upload to disk image through image_transfers_service
Summary: Cannot upload to disk image through image_transfers_service
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backend.Core
Version: 4.1.0.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ovirt-4.1.1
: ---
Assignee: Daniel Erez
QA Contact: meital avital
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-23 19:11 UTC by Egor
Modified: 2017-01-27 11:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-27 11:56:20 UTC
oVirt Team: Storage
rule-engine: ovirt-4.1+


Attachments (Terms of Use)
Uploading script and result of its execution. (2.81 KB, application/zip)
2017-01-23 19:11 UTC, Egor
no flags Details
Disk uploading with ca.pem artefacts (5.30 KB, application/zip)
2017-01-24 11:46 UTC, Egor
no flags Details
ovirt log files (1.49 MB, application/zip)
2017-01-24 13:38 UTC, Egor
no flags Details
List of processes on ovirt-engine (26.44 KB, text/plain)
2017-01-24 13:50 UTC, Egor
no flags Details
Screenshot of the uploading process (57.90 KB, image/png)
2017-01-25 16:24 UTC, Egor
no flags Details
Ovirt engine logs (5.61 MB, application/zip)
2017-01-25 16:29 UTC, Egor
no flags Details
Upload of disk from a different host (5.62 MB, application/zip)
2017-01-25 20:50 UTC, Egor
no flags Details

Description Egor 2017-01-23 19:11:26 UTC
Created attachment 1243750 [details]
Uploading script and result of its execution.

Description of problem:
I am trying to start image transfer on an existing disk which is not attached to any of the virtual machines.

Here is python script that I use:
connection = sdk.Connection(
  url='https://.../ovirt-engine/api',
  username='admin@internal',
  password='1',
  insecure=True,
  debug=True,
  log=logging.getLogger()
)

system_service = connection.system_service()
transfers_service = system_service.image_transfers_service()

# Here is the problem
transfer = transfers_service.add(
  types.ImageTransfer(
    image=types.Image(
      id='...'
    )
  )
)

# This will show me 'None'
print(transfer)

I have attached full script and log file where you can see more details.

Basically, the problem boils down to the fact that I receive 'HTTP/1.1 404 Not Found'.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Try to upload raw image using python sdk on a disk which in NOT attached to virtual machine.

Actual results:
I receive error 'HTTP/1.1 404 Not Found'


Expected results:
Method 'transfers_service.add(..)' has successfully completed.


Additional info:
1. I do everything with admin rights.
2. disks.xml contains result of the following command: 'curl -kv -u "admin@internal:1" -H "Content-Type: application/xml" -H "Accept: application/xml" https://.../ovirt-engine/api/disks'

Comment 1 Daniel Erez 2017-01-24 10:25:36 UTC
Hi Egor,

Uploading an image requires a secured channel.
Can you please try to upload following the example here:
https://gerrit.ovirt.org/gitweb?p=ovirt-engine-sdk.git;a=blob_plain;f=sdk/examples/upload_disk.py

Comment 2 Egor 2017-01-24 10:53:47 UTC
Hi Daniel!

I want to clarify one thing.
Do you mean that I cannot use option "insecure=True", when uploading disk image and I must use option "ca_file='ca.pem'" instead?

Comment 3 Daniel Erez 2017-01-24 10:57:16 UTC
(In reply to Egor from comment #2)
> Hi Daniel!
> 
> I want to clarify one thing.
> Do you mean that I cannot use option "insecure=True", when uploading disk
> image and I must use option "ca_file='ca.pem'" instead?

Yes, we're currently not supporting unsecured image upload.

Comment 4 Egor 2017-01-24 11:46:06 UTC
Created attachment 1243895 [details]
Disk uploading with ca.pem artefacts

1. Script used to create disk image and start uploading.
2. Log file created as a result of execution of that script.
3. Certificate used to connect to server.

Comment 5 Egor 2017-01-24 11:49:54 UTC
(In reply to Daniel Erez from comment #3)
> (In reply to Egor from comment #2)
> > Hi Daniel!
> > 
> > I want to clarify one thing.
> > Do you mean that I cannot use option "insecure=True", when uploading disk
> > image and I must use option "ca_file='ca.pem'" instead?
> 
> Yes, we're currently not supporting unsecured image upload.

Disk image is created without any errors, but I get the same error when adding ImageTransfer.

I have changed the example script a bit, so that it is easier to localize the problem.

Comment 6 Daniel Erez 2017-01-24 12:35:06 UTC
@Egor - can you please upload image-proxy.log and daemon.log as well?

Comment 7 Egor 2017-01-24 13:38:40 UTC
Created attachment 1243908 [details]
ovirt log files

I could not find daemon.log file, so I have gathered all of the logs in the folders "/var/log/ovirt-*".

Comment 8 Egor 2017-01-24 13:50:13 UTC
Created attachment 1243909 [details]
List of processes on ovirt-engine

Result of the command "ps aux".

Comment 9 Daniel Erez 2017-01-24 13:52:09 UTC
@Natalie - IIRC, you've tried a similar flow as described? Are you familiar with this issue perhaps?

Comment 10 Egor 2017-01-25 11:43:30 UTC
Do you need any additional info from my side?

Comment 11 Daniel Erez 2017-01-25 13:34:03 UTC
@Egor - I've just tried the example in a local environment and it seems to work as expected. Looking at your log, I suspect that the problem lies at the connection [1]. Seems to use port 8080, whereas it should use secured port 443. Have you disabled imageio-proxy SSL perhaps?

[1]
DEBUG:root:Connected to xz.avp.ru (10.69.112.2) port 8080 (#2)
DEBUG:root:POST /ovirt-engine/api/imagetransfers HTTP/1.1

Comment 12 Egor 2017-01-25 16:21:57 UTC
(In reply to Daniel Erez from comment #11)
> @Egor - I've just tried the example in a local environment and it seems to
> work as expected. Looking at your log, I suspect that the problem lies at
> the connection [1]. Seems to use port 8080, whereas it should use secured
> port 443. Have you disabled imageio-proxy SSL perhaps?
> 
> [1]
> DEBUG:root:Connected to xz.avp.ru (10.69.112.2) port 8080 (#2)
> DEBUG:root:POST /ovirt-engine/api/imagetransfers HTTP/1.1

No, I didn't disable SSL. This is a proxy host and the port is correct.

I have tried to upload image through web interface and everything works fine. The logic in web interface is the same as in the python script right?

Comment 13 Egor 2017-01-25 16:24:05 UTC
Created attachment 1244303 [details]
Screenshot of the uploading process

The uploading process of an image to the disk through web interface which is hosted on ovirt-engine.

Comment 14 Daniel Erez 2017-01-25 16:28:56 UTC
(In reply to Egor from comment #12)
> (In reply to Daniel Erez from comment #11)
> > @Egor - I've just tried the example in a local environment and it seems to
> > work as expected. Looking at your log, I suspect that the problem lies at
> > the connection [1]. Seems to use port 8080, whereas it should use secured
> > port 443. Have you disabled imageio-proxy SSL perhaps?
> > 
> > [1]
> > DEBUG:root:Connected to xz.avp.ru (10.69.112.2) port 8080 (#2)
> > DEBUG:root:POST /ovirt-engine/api/imagetransfers HTTP/1.1
> 
> No, I didn't disable SSL. This is a proxy host and the port is correct.
> 
> I have tried to upload image through web interface and everything works
> fine. The logic in web interface is the same as in the python script right?

The logic is similar, but the client is different.. Can you please try to run the script on a different machine to see if it behaves the same (and attach the log please).

Comment 15 Egor 2017-01-25 16:29:00 UTC
Created attachment 1244304 [details]
Ovirt engine logs

ovirt-engine log files after successfull uploading of a .raw image though web interface.

2017-01-25 18:26:11,342 INFO  [org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand] (DefaultQuartzScheduler4) [2d3bb0cb] Successfully uploaded disk 'my-Disk1' (id 'd074b503-3f8b-47f4-bda0-dd5e4d7110c2') (command id '2b52adcb-0d2a-44f7-b8b9-ad1f16e75f47')

Comment 16 Egor 2017-01-25 16:32:32 UTC
(In reply to Daniel Erez from comment #14)
> (In reply to Egor from comment #12)
> > (In reply to Daniel Erez from comment #11)
> > > @Egor - I've just tried the example in a local environment and it seems to
> > > work as expected. Looking at your log, I suspect that the problem lies at
> > > the connection [1]. Seems to use port 8080, whereas it should use secured
> > > port 443. Have you disabled imageio-proxy SSL perhaps?
> > > 
> > > [1]
> > > DEBUG:root:Connected to xz.avp.ru (10.69.112.2) port 8080 (#2)
> > > DEBUG:root:POST /ovirt-engine/api/imagetransfers HTTP/1.1
> > 
> > No, I didn't disable SSL. This is a proxy host and the port is correct.
> > 
> > I have tried to upload image through web interface and everything works
> > fine. The logic in web interface is the same as in the python script right?
> 
> The logic is similar, but the client is different.. Can you please try to
> run the script on a different machine to see if it behaves the same (and
> attach the log please).

Ok, I'll try now.

Comment 17 Egor 2017-01-25 16:52:39 UTC
(In reply to Egor from comment #16)
> (In reply to Daniel Erez from comment #14)
> > (In reply to Egor from comment #12)
> > > (In reply to Daniel Erez from comment #11)
> > > > @Egor - I've just tried the example in a local environment and it seems to
> > > > work as expected. Looking at your log, I suspect that the problem lies at
> > > > the connection [1]. Seems to use port 8080, whereas it should use secured
> > > > port 443. Have you disabled imageio-proxy SSL perhaps?
> > > > 
> > > > [1]
> > > > DEBUG:root:Connected to xz.avp.ru (10.69.112.2) port 8080 (#2)
> > > > DEBUG:root:POST /ovirt-engine/api/imagetransfers HTTP/1.1
> > > 
> > > No, I didn't disable SSL. This is a proxy host and the port is correct.
> > > 
> > > I have tried to upload image through web interface and everything works
> > > fine. The logic in web interface is the same as in the python script right?
> > 
> > The logic is similar, but the client is different.. Can you please try to
> > run the script on a different machine to see if it behaves the same (and
> > attach the log please).
> 
> Ok, I'll try now.

Well, it looks like I will not be able to check that today, so I'll do that tomorrow.

For now, could you, please, describe what could be the difference in the clients that leads to success of the web uploading and failure of the python script? In any case, I will need to implement all of the logic in c#, so I just need the correct order of REST API invocations. I got involved with all of that scripting just to prove the concept is working.

Comment 18 Egor 2017-01-25 20:50:47 UTC
Created attachment 1244419 [details]
Upload of disk from a different host

I receive the same error (404) when I tried to run the script from a different computer (Ubuntu).

And there were a little bit more warnings on top of that:

/usr/lib/python2.7/dist-packages/pkg_resources.py:1031: UserWarning:
/home/egor/.python-eggs is writable by group/others and vulnerable to attack
when used with get_resource_filename. Consider a more secure location (set
with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
  warnings.warn(msg, UserWarning)
Created Disk
Traceback (most recent call last):
  File "./upload_disk.py", line 64, in <module>
    id=disk.id
  File "build/bdist.linux-x86_64/egg/ovirtsdk4/services.py", line 10701, 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: HTTP response code is 404.

Comment 19 Daniel Erez 2017-01-25 22:24:56 UTC
Can you please try to verify that 'imagetransfers' api is indeed available in your build:

1. GET /ovirt-engine/api/imagetransfers

Should return a list of image_transfers elements 


2. rpm -qa | grep python-ovirt-engine-sdk

Should be >= python-ovirt-engine-sdk4-4.0.2-1.el7ev.x86_64

Comment 20 Egor 2017-01-26 11:16:43 UTC
(In reply to Daniel Erez from comment #19)
> Can you please try to verify that 'imagetransfers' api is indeed available
> in your build:
> 
> 1. GET /ovirt-engine/api/imagetransfers
> 
> Should return a list of image_transfers elements 
> 
> 
> 2. rpm -qa | grep python-ovirt-engine-sdk
> 
> Should be >= python-ovirt-engine-sdk4-4.0.2-1.el7ev.x86_64


1. curl -kv -u "admin@internal:1" -H "Content-Type: application/xml" -H "Accept: application/xml" https://../ovirt-engine/api/imagetransfers

* About to connect() to proxy ... port 8080 (#0)
*   Trying 10.69.112.2...
* Connected to ... (10.69.112.2) port 8080 (#0)
* Establish HTTP proxy tunnel to ...:443
* Server auth using Basic with user 'admin@internal'
> CONNECT ...:443 HTTP/1.1
> Host: ...:443
> User-Agent: curl/7.29.0
> Proxy-Connection: Keep-Alive
> Content-Type: application/xml
> Accept: application/xml
> 
< HTTP/1.1 200 Connection established
< 
* Proxy replied OK to CONNECT request
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
* 	subject: CN=...,O=...,C=US
* 	start date: Nov 16 16:57:37 2016 GMT
* 	expire date: Oct 22 16:57:37 2021 GMT
* 	common name: ...
* 	issuer: CN=...45623,O=...,C=US
* Server auth using Basic with user 'admin@internal'
> GET /ovirt-engine/api/imagetransfers HTTP/1.1
> Authorization: Basic YWRtaW5AaW50ZXJuYWw6MQ==
> User-Agent: curl/7.29.0
> Host: ...
> Content-Type: application/xml
> Accept: application/xml
> 
< HTTP/1.1 404 Not Found
< Date: Thu, 26 Jan 2017 11:09:32 GMT
< Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips
< Content-Length: 0
< 
* Connection #0 to host ... left intact

2. rpm -qa | grep python-ovirt-engine-sdk
python-ovirt-engine-sdk4-4.0.4-1.el7.centos.x86_64

Comment 21 Egor 2017-01-26 12:02:04 UTC
By the way, how to interpret the following error message in engine.log?

2017-01-25 23:43:23,554 ERROR [org.ovirt.engine.core.utils.servlet.ServletUtils] (default task-19) [] Can't read file '/usr/share/ovirt-engine/files/spice/SpiceVersion.txt' for request '/ovirt-engine/services/files/spice/SpiceVersion.txt', will send a 404 error response.

Comment 22 Daniel Erez 2017-01-26 12:22:14 UTC
(In reply to Egor from comment #21)
> By the way, how to interpret the following error message in engine.log?
> 
> 2017-01-25 23:43:23,554 ERROR
> [org.ovirt.engine.core.utils.servlet.ServletUtils] (default task-19) []
> Can't read file '/usr/share/ovirt-engine/files/spice/SpiceVersion.txt' for
> request '/ovirt-engine/services/files/spice/SpiceVersion.txt', will send a
> 404 error response.

I don't think it's relevant.. we're using vnc/virt-viewer now.

So you're getting no response from /ovirt-engine/api/imagetransfers,
maybe an old build of ovirt is still installed.

What's the output of 'rpm -qa | grep ovirt-engine'?

Comment 23 Egor 2017-01-26 13:02:00 UTC
(In reply to Daniel Erez from comment #22)
> So you're getting no response from /ovirt-engine/api/imagetransfers,
> maybe an old build of ovirt is still installed.

I don't know.


> What's the output of 'rpm -qa | grep ovirt-engine'?

ovirt-engine-setup-plugin-ovirt-engine-4.0.6.3-1.el7.centos.noarch
ovirt-engine-setup-4.0.6.3-1.el7.centos.noarch
ovirt-engine-restapi-4.0.5.5-1.el7.centos.noarch
ovirt-engine-extension-aaa-jdbc-1.1.1-1.el7.noarch
ovirt-engine-tools-backup-4.0.5.5-1.el7.centos.noarch
ovirt-engine-dashboard-1.0.5-1.el7.centos.noarch
ovirt-engine-lib-4.0.6.3-1.el7.centos.noarch
ovirt-engine-extensions-api-impl-4.0.6.3-1.el7.centos.noarch
ovirt-engine-setup-plugin-ovirt-engine-common-4.0.6.3-1.el7.centos.noarch
ovirt-engine-vmconsole-proxy-helper-4.0.6.3-1.el7.centos.noarch
ovirt-engine-cli-3.6.8.1-1.el7.centos.noarch
ovirt-engine-userportal-4.0.5.5-1.el7.centos.noarch
ovirt-engine-setup-plugin-vmconsole-proxy-helper-4.0.6.3-1.el7.centos.noarch
ovirt-engine-sdk-python-3.6.9.1-1.el7.centos.noarch
ovirt-engine-tools-4.0.5.5-1.el7.centos.noarch
ovirt-engine-wildfly-10.1.0-1.el7.x86_64
ovirt-engine-dwh-4.0.5-1.el7.centos.noarch
ovirt-engine-backend-4.0.5.5-1.el7.centos.noarch
ovirt-engine-setup-plugin-websocket-proxy-4.0.6.3-1.el7.centos.noarch
ovirt-engine-websocket-proxy-4.0.6.3-1.el7.centos.noarch
python-ovirt-engine-sdk4-4.0.4-1.el7.centos.x86_64
ovirt-engine-dbscripts-4.0.5.5-1.el7.centos.noarch
ovirt-engine-setup-base-4.0.6.3-1.el7.centos.noarch
ovirt-engine-4.0.5.5-1.el7.centos.noarch
ovirt-engine-wildfly-overlay-10.0.0-1.el7.noarch
ovirt-engine-dwh-setup-4.0.6-1.el7.centos.noarch
ovirt-engine-webadmin-portal-4.0.5.5-1.el7.centos.noarch

Comment 24 Daniel Erez 2017-01-26 13:07:39 UTC
(In reply to Egor from comment #23)
> (In reply to Daniel Erez from comment #22)
> > So you're getting no response from /ovirt-engine/api/imagetransfers,
> > maybe an old build of ovirt is still installed.
> 
> I don't know.
> 
> 
> > What's the output of 'rpm -qa | grep ovirt-engine'?
> 
> ovirt-engine-setup-plugin-ovirt-engine-4.0.6.3-1.el7.centos.noarch
> ovirt-engine-setup-4.0.6.3-1.el7.centos.noarch
> ovirt-engine-restapi-4.0.5.5-1.el7.centos.noarch
> ovirt-engine-extension-aaa-jdbc-1.1.1-1.el7.noarch
> ovirt-engine-tools-backup-4.0.5.5-1.el7.centos.noarch
> ovirt-engine-dashboard-1.0.5-1.el7.centos.noarch
> ovirt-engine-lib-4.0.6.3-1.el7.centos.noarch
> ovirt-engine-extensions-api-impl-4.0.6.3-1.el7.centos.noarch
> ovirt-engine-setup-plugin-ovirt-engine-common-4.0.6.3-1.el7.centos.noarch
> ovirt-engine-vmconsole-proxy-helper-4.0.6.3-1.el7.centos.noarch
> ovirt-engine-cli-3.6.8.1-1.el7.centos.noarch
> ovirt-engine-userportal-4.0.5.5-1.el7.centos.noarch
> ovirt-engine-setup-plugin-vmconsole-proxy-helper-4.0.6.3-1.el7.centos.noarch
> ovirt-engine-sdk-python-3.6.9.1-1.el7.centos.noarch
> ovirt-engine-tools-4.0.5.5-1.el7.centos.noarch
> ovirt-engine-wildfly-10.1.0-1.el7.x86_64
> ovirt-engine-dwh-4.0.5-1.el7.centos.noarch
> ovirt-engine-backend-4.0.5.5-1.el7.centos.noarch
> ovirt-engine-setup-plugin-websocket-proxy-4.0.6.3-1.el7.centos.noarch
> ovirt-engine-websocket-proxy-4.0.6.3-1.el7.centos.noarch
> python-ovirt-engine-sdk4-4.0.4-1.el7.centos.x86_64
> ovirt-engine-dbscripts-4.0.5.5-1.el7.centos.noarch
> ovirt-engine-setup-base-4.0.6.3-1.el7.centos.noarch
> ovirt-engine-4.0.5.5-1.el7.centos.noarch
> ovirt-engine-wildfly-overlay-10.0.0-1.el7.noarch
> ovirt-engine-dwh-setup-4.0.6-1.el7.centos.noarch
> ovirt-engine-webadmin-portal-4.0.5.5-1.el7.centos.noarch

Makes sense :)
The imagetransfers api has been added only in 4.1.
Please update and try again.

Comment 25 Egor 2017-01-26 13:21:37 UTC
(In reply to Daniel Erez from comment #24)
> (In reply to Egor from comment #23)
> > (In reply to Daniel Erez from comment #22)
> > > So you're getting no response from /ovirt-engine/api/imagetransfers,
> > > maybe an old build of ovirt is still installed.
> > 
> > I don't know.
> > 
> > 
> > > What's the output of 'rpm -qa | grep ovirt-engine'?
> > 
> > ovirt-engine-setup-plugin-ovirt-engine-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-setup-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-restapi-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-extension-aaa-jdbc-1.1.1-1.el7.noarch
> > ovirt-engine-tools-backup-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-dashboard-1.0.5-1.el7.centos.noarch
> > ovirt-engine-lib-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-extensions-api-impl-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-setup-plugin-ovirt-engine-common-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-vmconsole-proxy-helper-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-cli-3.6.8.1-1.el7.centos.noarch
> > ovirt-engine-userportal-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-setup-plugin-vmconsole-proxy-helper-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-sdk-python-3.6.9.1-1.el7.centos.noarch
> > ovirt-engine-tools-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-wildfly-10.1.0-1.el7.x86_64
> > ovirt-engine-dwh-4.0.5-1.el7.centos.noarch
> > ovirt-engine-backend-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-setup-plugin-websocket-proxy-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-websocket-proxy-4.0.6.3-1.el7.centos.noarch
> > python-ovirt-engine-sdk4-4.0.4-1.el7.centos.x86_64
> > ovirt-engine-dbscripts-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-setup-base-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-wildfly-overlay-10.0.0-1.el7.noarch
> > ovirt-engine-dwh-setup-4.0.6-1.el7.centos.noarch
> > ovirt-engine-webadmin-portal-4.0.5.5-1.el7.centos.noarch
> 
> Makes sense :)
> The imagetransfers api has been added only in 4.1.
> Please update and try again.

I am sorry, but I don't know how to upgrade to 4.1. Could you, please, tell me what is the upgrade command?

Comment 26 Egor 2017-01-26 13:37:36 UTC
(In reply to Daniel Erez from comment #24)
> (In reply to Egor from comment #23)
> > (In reply to Daniel Erez from comment #22)
> > > So you're getting no response from /ovirt-engine/api/imagetransfers,
> > > maybe an old build of ovirt is still installed.
> > 
> > I don't know.
> > 
> > 
> > > What's the output of 'rpm -qa | grep ovirt-engine'?
> > 
> > ovirt-engine-setup-plugin-ovirt-engine-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-setup-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-restapi-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-extension-aaa-jdbc-1.1.1-1.el7.noarch
> > ovirt-engine-tools-backup-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-dashboard-1.0.5-1.el7.centos.noarch
> > ovirt-engine-lib-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-extensions-api-impl-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-setup-plugin-ovirt-engine-common-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-vmconsole-proxy-helper-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-cli-3.6.8.1-1.el7.centos.noarch
> > ovirt-engine-userportal-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-setup-plugin-vmconsole-proxy-helper-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-sdk-python-3.6.9.1-1.el7.centos.noarch
> > ovirt-engine-tools-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-wildfly-10.1.0-1.el7.x86_64
> > ovirt-engine-dwh-4.0.5-1.el7.centos.noarch
> > ovirt-engine-backend-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-setup-plugin-websocket-proxy-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-websocket-proxy-4.0.6.3-1.el7.centos.noarch
> > python-ovirt-engine-sdk4-4.0.4-1.el7.centos.x86_64
> > ovirt-engine-dbscripts-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-setup-base-4.0.6.3-1.el7.centos.noarch
> > ovirt-engine-4.0.5.5-1.el7.centos.noarch
> > ovirt-engine-wildfly-overlay-10.0.0-1.el7.noarch
> > ovirt-engine-dwh-setup-4.0.6-1.el7.centos.noarch
> > ovirt-engine-webadmin-portal-4.0.5.5-1.el7.centos.noarch
> 
> Makes sense :)
> The imagetransfers api has been added only in 4.1.
> Please update and try again.

Wait a minute. In the documentation https://.../ovirt-engine/api/v4/model there is a section about "4.101. ImageTransfer". And in that section documentation describes how to upload image using Python SDK.

"
4.101. ImageTransfer
This service provides a mechanism to control an image transfer. The client will have to create a transfer by using add of the ImageTransfers service, stating the image to transfer data to/from.

After doing that, the transfer is managed by this service.

E.g., for uploading to the disk image with id 52cb593f-837c-4633-a444-35a0a0383706, the client can use oVirt’s Python’s SDK as follows:

transfers_service = system_service.image_transfers_service()
transfer = transfers_service.add(
   types.ImageTransfer(
      image=types.Image(
         id='52cb593f-837c-4633-a444-35a0a0383706'
      )
   )
)
Transfers have phases
...
"

The second thing that bothers me is that I can upload an image through web console. How can I replicate the things that the web console does without upgrading packages on my host?

Comment 27 Daniel Erez 2017-01-26 13:45:38 UTC
I see it's been added in ovirt 4.0.6, please try to install the latest 4.0 repositories and 'dnf update ovirt-engine':

http://resources.ovirt.org/pub/yum-repo/ovirt-release40-pre.rpm
http://resources.ovirt.org/pub/yum-repo/ovirt-release40-snapshot.rpm
http://resources.ovirt.org/pub/yum-repo/ovirt-release40.rpm

Comment 28 Egor 2017-01-27 10:47:49 UTC
I have executed command 'dnf update ovirt-engine'.
Now I have the following list of packages installed:
ovirt-engine-tools-4.0.6.3-1.el7.centos.noarch
ovirt-engine-setup-plugin-ovirt-engine-4.0.6.3-1.el7.centos.noarch
ovirt-engine-backend-4.0.6.3-1.el7.centos.noarch
ovirt-engine-setup-4.0.6.3-1.el7.centos.noarch
ovirt-engine-4.0.6.3-1.el7.centos.noarch
ovirt-engine-extension-aaa-jdbc-1.1.1-1.el7.noarch
ovirt-engine-tools-backup-4.0.6.3-1.el7.centos.noarch
ovirt-engine-dashboard-1.0.5-1.el7.centos.noarch
ovirt-engine-lib-4.0.6.3-1.el7.centos.noarch
ovirt-engine-extensions-api-impl-4.0.6.3-1.el7.centos.noarch
ovirt-engine-setup-plugin-ovirt-engine-common-4.0.6.3-1.el7.centos.noarch
ovirt-engine-vmconsole-proxy-helper-4.0.6.3-1.el7.centos.noarch
ovirt-engine-userportal-4.0.6.3-1.el7.centos.noarch
ovirt-engine-cli-3.6.8.1-1.el7.centos.noarch
ovirt-engine-setup-plugin-vmconsole-proxy-helper-4.0.6.3-1.el7.centos.noarch
ovirt-engine-webadmin-portal-4.0.6.3-1.el7.centos.noarch
ovirt-engine-sdk-python-3.6.9.1-1.el7.centos.noarch
ovirt-engine-wildfly-10.1.0-1.el7.x86_64
ovirt-engine-restapi-4.0.6.3-1.el7.centos.noarch
ovirt-engine-dwh-4.0.5-1.el7.centos.noarch
ovirt-engine-setup-plugin-websocket-proxy-4.0.6.3-1.el7.centos.noarch
ovirt-engine-websocket-proxy-4.0.6.3-1.el7.centos.noarch
python-ovirt-engine-sdk4-4.0.4-1.el7.centos.x86_64
ovirt-engine-setup-base-4.0.6.3-1.el7.centos.noarch
ovirt-engine-wildfly-overlay-10.0.0-1.el7.noarch
ovirt-engine-dbscripts-4.0.6.3-1.el7.centos.noarch
ovirt-engine-dwh-setup-4.0.6-1.el7.centos.noarch


After this update image uploading has started to work! I think this information has to be added somewhere in documentation.

Thank you, Daniel!

Comment 29 Daniel Erez 2017-01-27 11:56:20 UTC
Indeed, probably should be added to https://www.ovirt.org/release/4.0.6/
Closing.


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