<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Sep 12, 2017 at 5:45 PM Matthias Leopold <<a href="mailto:matthias.leopold@meduniwien.ac.at">matthias.leopold@meduniwien.ac.at</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks, i tried this script and it _almost_ worked ;-)<br>
<br>
i uploaded two images i created with<br>
qemu-img create -f qcow2 -o preallocation=full<br>
and<br>
qemu-img create -f qcow2 -o preallocation=falloc<br>
<br>
for initial_size and provisioned_size i took the value reported by<br>
"qemu-img info" in "virtual size" (same as "disk size" in this case)</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
the upload goes to 100% and then fails with<br>
<br>
200 OK Completed 100%<br>
Traceback (most recent call last):<br>
File "./upload_disk.py", line 157, in <module><br>
headers=upload_headers,<br>
File "/usr/lib64/python2.7/httplib.py", line 1017, in request<br>
self._send_request(method, url, body, headers)<br>
File "/usr/lib64/python2.7/httplib.py", line 1051, in _send_request<br>
self.endheaders(body)<br>
File "/usr/lib64/python2.7/httplib.py", line 1013, in endheaders<br>
self._send_output(message_body)<br>
File "/usr/lib64/python2.7/httplib.py", line 864, in _send_output<br>
self.send(msg)<br>
File "/usr/lib64/python2.7/httplib.py", line 840, in send<br>
self.sock.sendall(data)<br>
File "/usr/lib64/python2.7/ssl.py", line 746, in sendall<br>
v = self.send(data[count:])<br>
File "/usr/lib64/python2.7/ssl.py", line 712, in send<br>
v = self._sslobj.write(data)<br>
socket.error: [Errno 104] Connection reset by peer<br>
<br>
in web GUI the disk stays in Status: "Transferring via API"<br>
it can only be removed when manually unlocking it (unlock_entity.sh)<br>
<br>
engine.log tells nothing interesting<br>
<br>
i attached the last lines of ovirt-imageio-proxy/image-proxy.log and<br>
ovirt-imageio-daemon/daemon.log (from the executing node)<br>
<br>
the HTTP status 403 in ovirt-imageio-daemon/daemon.log doesn't look too<br>
nice to me<br>
<br>
can you explain what happens?<br></blockquote><div><br></div><div>Hi Matthias,</div><div><br></div><div>I think qemu-img reports the wrong size in disk size, so the disk you created</div><div>for the upload was smaller than the file you tried to upload. This will end in</div><div>404 forbidden error when you try to write after the end of the specified</div><div>size.</div><div><br></div><div><div>In this case we send a detailed error to the proxy but it cannot get this response</div><div>since it tries to send the data to the daemon, but the daemon will never read</div><div>data from invalid request.</div><br class="inbox-inbox-Apple-interchange-newline"></div><div>You should get the file size using os.path.getsize() instead of qemu-img info.</div><div><br></div><div>That said, our logging is not good enough:<br></div><div><br></div><div><div>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)<br></div><br class="inbox-inbox-Apple-interchange-newline"></div><div><div>This log should explain why the operation is forbidden - for example:<br></div><div><br></div><div> Trying to write to offset x, maximum offset y</div></div><div><br></div><div><div>Can you file a bug for more detailed logging when upload/download request is invalid?<br></div><div> <br></div><div>Regarding the logs you submitted, please submit complete logs. For example</div><div>in this case we would see the ticket size in the log for adding the ticket for this</div><div>upload, which makes the issue more clear.</div><div> <br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
ovirt engine is 4.1.5<br>
ovirt node is 4.1.3 (is that a problem?)<br></blockquote><div><br></div><div>No but you want to run latest code to get the all the fixes introduced</div><div>in 4.1.5.</div><div><br></div><div><div>Cheers,</div><div>Nir</div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
thx<br>
matthias<br>
<br>
<br>
<br>
Am 2017-09-12 um 13:15 schrieb Fred Rolland:<br>
> Hi,<br>
><br>
> You can check this example:<br>
> <a href="https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/upload_disk.py" rel="noreferrer" target="_blank">https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/upload_disk.py</a><br>
><br>
> Regards,<br>
> Fred<br>
><br>
> On Tue, Sep 12, 2017 at 11:49 AM, Matthias Leopold<br>
> <<a href="mailto:matthias.leopold@meduniwien.ac.at" target="_blank">matthias.leopold@meduniwien.ac.at</a><br>
> <mailto:<a href="mailto:matthias.leopold@meduniwien.ac.at" target="_blank">matthias.leopold@meduniwien.ac.at</a>>> wrote:<br>
><br>
> Hi,<br>
><br>
> is there a way to upload disk images (not OVF files, not ISO files)<br>
> to oVirt storage domains via CLI? I need to upload a 800GB file and<br>
> this is not really comfortable via browser. I looked at ovirt-shell<br>
> and<br>
> <a href="https://www.ovirt.org/develop/release-management/features/storage/image-upload/" rel="noreferrer" target="_blank">https://www.ovirt.org/develop/release-management/features/storage/image-upload/</a><br>
> <<a href="https://www.ovirt.org/develop/release-management/features/storage/image-upload/" rel="noreferrer" target="_blank">https://www.ovirt.org/develop/release-management/features/storage/image-upload/</a>>,<br>
> but i didn't find an option in either of them.<br>
><br>
> thx<br>
> matthias<br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a> <mailto:<a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a>><br>
> <a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
> <<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a>><br>
><br>
><br>
<br>
--<br>
Matthias Leopold<br>
IT Systems & Communications<br>
Medizinische Universität Wien<br>
Spitalgasse 23 / BT 88 /Ebene 00<br>
A-1090 Wien<br>
Tel: <a href="tel:+43%201%204016021241" value="+4314016021241" target="_blank">+43 1 40160-21241</a><br>
Fax: <a href="tel:+43%201%2040160921200" value="+43140160921200" target="_blank">+43 1 40160-921200</a><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
</blockquote></div></div>