Thanks, i tried this script and it _almost_ worked ;-)

i uploaded two images i created with
qemu-img create -f qcow2 -o preallocation=full
and
qemu-img create -f qcow2 -o preallocation=falloc

for initial_size and provisioned_size i took the value reported by "qemu-img info" in "virtual size" (same as "disk size" in this case)

the upload goes to 100% and then fails with

200 OK Completed 100%
Traceback (most recent call last):
  File "./upload_disk.py", line 157, in <module>
    headers=upload_headers,
  File "/usr/lib64/python2.7/httplib.py", line 1017, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.7/httplib.py", line 1051, in _send_request
    self.endheaders(body)
  File "/usr/lib64/python2.7/httplib.py", line 1013, in endheaders
    self._send_output(message_body)
  File "/usr/lib64/python2.7/httplib.py", line 864, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.7/httplib.py", line 840, in send
    self.sock.sendall(data)
  File "/usr/lib64/python2.7/ssl.py", line 746, in sendall
    v = self.send(data[count:])
  File "/usr/lib64/python2.7/ssl.py", line 712, in send
    v = self._sslobj.write(data)
socket.error: [Errno 104] Connection reset by peer

in web GUI the disk stays in Status: "Transferring via API"
it can only be removed when manually unlocking it (unlock_entity.sh)

engine.log tells nothing interesting

i attached the last lines of ovirt-imageio-proxy/image-proxy.log and ovirt-imageio-daemon/daemon.log (from the executing node)

the HTTP status 403 in ovirt-imageio-daemon/daemon.log doesn't look too nice to me

can you explain what happens?

ovirt engine is 4.1.5
ovirt node is 4.1.3 (is that a problem?)

thx
matthias



Am 2017-09-12 um 13:15 schrieb Fred Rolland:
Hi,

You can check this example:
https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/upload_disk.py

Regards,
Fred

On Tue, Sep 12, 2017 at 11:49 AM, Matthias Leopold <matthias.leop...@meduniwien.ac.at <mailto:matthias.leop...@meduniwien.ac.at>> wrote:

    Hi,

    is there a way to upload disk images (not OVF files, not ISO files)
    to oVirt storage domains via CLI? I need to upload a 800GB file and
    this is not really comfortable via browser. I looked at ovirt-shell
    and
    
https://www.ovirt.org/develop/release-management/features/storage/image-upload/
    
<https://www.ovirt.org/develop/release-management/features/storage/image-upload/>,
    but i didn't find an option in either of them.

    thx
    matthias

    _______________________________________________
    Users mailing list
    Users@ovirt.org <mailto:Users@ovirt.org>
    http://lists.ovirt.org/mailman/listinfo/users
    <http://lists.ovirt.org/mailman/listinfo/users>



--
Matthias Leopold
IT Systems & Communications
Medizinische Universität Wien
Spitalgasse 23 / BT 88 /Ebene 00
A-1090 Wien
Tel: +43 1 40160-21241
Fax: +43 1 40160-921200
2017-09-12 16:07:10,046 INFO    (Thread-632) [web] xxx.yyy.215.2 - PUT /1e12aa19-f122-4f6c-bfad-ce84abe2684e 200 0 (0.28s)
2017-09-12 16:07:10,171 INFO    (Thread-633) [images] Writing 8388608 bytes at offset 5301600256 to /rhev/data-center/00000001-0001-0001-0001-000000000311/ebb620c9-6dfe-43a8-9867-20b9a93c76b5/images/54b6da51-1c67-42e9-b128-0a218fa1e8b7/e0c1ab33-a817-4207-b1f9-32f1aa4e46be for ticket 1e12aa19-f122-4f6c-bfad-ce84abe2684e
2017-09-12 16:07:10,439 INFO    (Thread-633) [web] xxx.yyy.215.2 - PUT /1e12aa19-f122-4f6c-bfad-ce84abe2684e 200 0 (0.27s)
2017-09-12 16:07:10,556 INFO    (Thread-634) [images] Writing 8388608 bytes at offset 5309988864 to /rhev/data-center/00000001-0001-0001-0001-000000000311/ebb620c9-6dfe-43a8-9867-20b9a93c76b5/images/54b6da51-1c67-42e9-b128-0a218fa1e8b7/e0c1ab33-a817-4207-b1f9-32f1aa4e46be for ticket 1e12aa19-f122-4f6c-bfad-ce84abe2684e
2017-09-12 16:07:10,819 INFO    (Thread-634) [web] xxx.yyy.215.2 - PUT /1e12aa19-f122-4f6c-bfad-ce84abe2684e 200 0 (0.26s)
2017-09-12 16:07:10,924 INFO    (Thread-635) [images] Writing 8388608 bytes at offset 5318377472 to /rhev/data-center/00000001-0001-0001-0001-000000000311/ebb620c9-6dfe-43a8-9867-20b9a93c76b5/images/54b6da51-1c67-42e9-b128-0a218fa1e8b7/e0c1ab33-a817-4207-b1f9-32f1aa4e46be for ticket 1e12aa19-f122-4f6c-bfad-ce84abe2684e
2017-09-12 16:07:11,219 INFO    (Thread-635) [web] xxx.yyy.215.2 - PUT /1e12aa19-f122-4f6c-bfad-ce84abe2684e 200 0 (0.30s)
2017-09-12 16:07:11,336 INFO    (Thread-636) [images] Writing 8388608 bytes at offset 5326766080 to /rhev/data-center/00000001-0001-0001-0001-000000000311/ebb620c9-6dfe-43a8-9867-20b9a93c76b5/images/54b6da51-1c67-42e9-b128-0a218fa1e8b7/e0c1ab33-a817-4207-b1f9-32f1aa4e46be for ticket 1e12aa19-f122-4f6c-bfad-ce84abe2684e
2017-09-12 16:07:11,595 INFO    (Thread-636) [web] xxx.yyy.215.2 - PUT /1e12aa19-f122-4f6c-bfad-ce84abe2684e 200 0 (0.26s)
2017-09-12 16:07:11,711 INFO    (Thread-637) [images] Writing 8388608 bytes at offset 5335154688 to /rhev/data-center/00000001-0001-0001-0001-000000000311/ebb620c9-6dfe-43a8-9867-20b9a93c76b5/images/54b6da51-1c67-42e9-b128-0a218fa1e8b7/e0c1ab33-a817-4207-b1f9-32f1aa4e46be for ticket 1e12aa19-f122-4f6c-bfad-ce84abe2684e
2017-09-12 16:07:11,966 INFO    (Thread-637) [web] xxx.yyy.215.2 - PUT /1e12aa19-f122-4f6c-bfad-ce84abe2684e 200 0 (0.26s)
2017-09-12 16:07:12,079 INFO    (Thread-638) [images] Writing 8388608 bytes at offset 5343543296 to /rhev/data-center/00000001-0001-0001-0001-000000000311/ebb620c9-6dfe-43a8-9867-20b9a93c76b5/images/54b6da51-1c67-42e9-b128-0a218fa1e8b7/e0c1ab33-a817-4207-b1f9-32f1aa4e46be for ticket 1e12aa19-f122-4f6c-bfad-ce84abe2684e
2017-09-12 16:07:12,344 INFO    (Thread-638) [web] xxx.yyy.215.2 - PUT /1e12aa19-f122-4f6c-bfad-ce84abe2684e 200 0 (0.26s)
2017-09-12 16:07:12,460 INFO    (Thread-639) [images] Writing 8388608 bytes at offset 5351931904 to /rhev/data-center/00000001-0001-0001-0001-000000000311/ebb620c9-6dfe-43a8-9867-20b9a93c76b5/images/54b6da51-1c67-42e9-b128-0a218fa1e8b7/e0c1ab33-a817-4207-b1f9-32f1aa4e46be for ticket 1e12aa19-f122-4f6c-bfad-ce84abe2684e
2017-09-12 16:07:12,744 INFO    (Thread-639) [web] xxx.yyy.215.2 - PUT /1e12aa19-f122-4f6c-bfad-ce84abe2684e 200 0 (0.29s)
2017-09-12 16:07:12,849 INFO    (Thread-640) [images] Writing 8388608 bytes at offset 5360320512 to /rhev/data-center/00000001-0001-0001-0001-000000000311/ebb620c9-6dfe-43a8-9867-20b9a93c76b5/images/54b6da51-1c67-42e9-b128-0a218fa1e8b7/e0c1ab33-a817-4207-b1f9-32f1aa4e46be for ticket 1e12aa19-f122-4f6c-bfad-ce84abe2684e
2017-09-12 16:07:13,107 INFO    (Thread-640) [web] xxx.yyy.215.2 - PUT /1e12aa19-f122-4f6c-bfad-ce84abe2684e 200 0 (0.26s)
2017-09-12 16:07:13,188 WARNING (Thread-641) [web] xxx.yyy.215.2 - PUT /1e12aa19-f122-4f6c-bfad-ce84abe2684e 403 138 (0.00s)
(Thread-63779) INFO 2017-09-12 16:07:12,437 session:280:root:(_decode_proxy_ticket) Proxy ticket valid: {u'iat': 1505224979, u'imaged-uri': u'https://some-node.some-domain:54322', u'nbf': 1505224979, u'exp': 1505228579, u'transfer-ticket': u'1e12aa19-f122-4f6c-bfad-ce84abe2684e'}
(Thread-63779) INFO 2017-09-12 16:07:12,438 session:212:root:(_create_update_session) Established session: expiration: '1505228579', imaged-host-uri: 'https://some-node.some-domain:54322', proxy-ticket: 'eyJzYWx0IjoiWm5kcm5RN2g2S2c9IiwiZGF0YSI6IntcbiAgXCJuYmZcIiA6...IjIwMTcwOTEyMTQwMjU5IiwidmFsaWRUbyI6IjIwMTcwOTEyMTUwMjU5In0=', session-id: '792c8369-3984-43b5-9e90-c33a770d9cf8', transfer-ticket: '1e12aa19-f122-4f6c-bfad-ce84abe2684e'
(Thread-63779) INFO 2017-09-12 16:07:12,439 connectionpool:735:requests.packages.urllib3.connectionpool:(_new_conn) Starting new HTTPS connection (1): some-node.some-domain
(Thread-63779) INFO 2017-09-12 16:07:12,746 web:89:web:(log_response) xxx.yyy.52.63 - PUT  200 0 (0.31s)
(Thread-63780) INFO 2017-09-12 16:07:12,827 session:280:root:(_decode_proxy_ticket) Proxy ticket valid: {u'iat': 1505224979, u'imaged-uri': u'https://some-node.some-domain:54322', u'nbf': 1505224979, u'exp': 1505228579, u'transfer-ticket': u'1e12aa19-f122-4f6c-bfad-ce84abe2684e'}
(Thread-63780) INFO 2017-09-12 16:07:12,828 session:212:root:(_create_update_session) Established session: expiration: '1505228579', imaged-host-uri: 'https://some-node.some-domain:54322', proxy-ticket: 'eyJzYWx0IjoiWm5kcm5RN2g2S2c9IiwiZGF0YSI6IntcbiAgXCJuYmZcIiA6...IjIwMTcwOTEyMTQwMjU5IiwidmFsaWRUbyI6IjIwMTcwOTEyMTUwMjU5In0=', session-id: '06173c33-ca50-480d-9ce2-cc16bfcc94e3', transfer-ticket: '1e12aa19-f122-4f6c-bfad-ce84abe2684e'
(Thread-63780) INFO 2017-09-12 16:07:12,830 connectionpool:735:requests.packages.urllib3.connectionpool:(_new_conn) Starting new HTTPS connection (1): some-node.some-domain
(Thread-63780) INFO 2017-09-12 16:07:13,109 web:89:web:(log_response) xxx.yyy.52.63 - PUT  200 0 (0.28s)
(Thread-63781) INFO 2017-09-12 16:07:13,165 session:280:root:(_decode_proxy_ticket) Proxy ticket valid: {u'iat': 1505224979, u'imaged-uri': u'https://some-node.some-domain:54322', u'nbf': 1505224979, u'exp': 1505228579, u'transfer-ticket': u'1e12aa19-f122-4f6c-bfad-ce84abe2684e'}
(Thread-63781) INFO 2017-09-12 16:07:13,165 session:212:root:(_create_update_session) Established session: expiration: '1505228579', imaged-host-uri: 'https://some-node.some-domain:54322', proxy-ticket: 'eyJzYWx0IjoiWm5kcm5RN2g2S2c9IiwiZGF0YSI6IntcbiAgXCJuYmZcIiA6...IjIwMTcwOTEyMTQwMjU5IiwidmFsaWRUbyI6IjIwMTcwOTEyMTUwMjU5In0=', session-id: 'fdbb44a9-28d8-4eea-90ad-342f88a0e71c', transfer-ticket: '1e12aa19-f122-4f6c-bfad-ce84abe2684e'
(Thread-63781) INFO 2017-09-12 16:07:13,167 connectionpool:735:requests.packages.urllib3.connectionpool:(_new_conn) Starting new HTTPS connection (1): some-node.some-domain
(Thread-63781) ERROR 2017-09-12 16:07:13,188 image_handler:186:root:(make_imaged_request) Failed communicating with vdsm-imaged: A Connection error occurred.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_proxy/image_handler.py", line 177, in make_imaged_request
    timeout=timeout, stream=stream)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 415, in send
    raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', error(32, 'Broken pipe'))
(Thread-63781) ERROR 2017-09-12 16:07:13,189 web:89:web:(log_response) xxx.yyy.52.63 - PUT  503 215 (0.02s)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_common/web.py", line 48, in __call__
    resp = self.dispatch(request)
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_common/web.py", line 73, in dispatch
    return method(*match.groups())
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_proxy/http_helper.py", line 88, in wrapper
    ret = func(self, *args)
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_proxy/http_helper.py", line 59, in wrapper
    ret = func(self, *args)
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_proxy/image_handler.py", line 75, in put
    return self.send_data(self.request)
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_proxy/image_handler.py", line 116, in send_data
    request.method, imaged_url, headers, body, stream)
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_proxy/image_handler.py", line 187, in make_imaged_request
    raise exc.HTTPServiceUnavailable(s)
HTTPServiceUnavailable: Failed communicating with vdsm-imaged: A Connection error occurred.

_______________________________________________
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users

Reply via email to