<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Sep 12, 2017 at 5:45 PM Matthias Leopold &lt;<a href="mailto:matthias.leopold@meduniwien.ac.at">matthias.leopold@meduniwien.ac.at</a>&gt; 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>
&quot;qemu-img info&quot; in &quot;virtual size&quot; (same as &quot;disk size&quot; 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 &quot;./upload_disk.py&quot;, line 157, in &lt;module&gt;<br>
     headers=upload_headers,<br>
   File &quot;/usr/lib64/python2.7/httplib.py&quot;, line 1017, in request<br>
     self._send_request(method, url, body, headers)<br>
   File &quot;/usr/lib64/python2.7/httplib.py&quot;, line 1051, in _send_request<br>
     self.endheaders(body)<br>
   File &quot;/usr/lib64/python2.7/httplib.py&quot;, line 1013, in endheaders<br>
     self._send_output(message_body)<br>
   File &quot;/usr/lib64/python2.7/httplib.py&quot;, line 864, in _send_output<br>
     self.send(msg)<br>
   File &quot;/usr/lib64/python2.7/httplib.py&quot;, line 840, in send<br>
     self.sock.sendall(data)<br>
   File &quot;/usr/lib64/python2.7/ssl.py&quot;, line 746, in sendall<br>
     v = self.send(data[count:])<br>
   File &quot;/usr/lib64/python2.7/ssl.py&quot;, 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: &quot;Transferring via API&quot;<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&#39;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>
&gt; Hi,<br>
&gt;<br>
&gt; You can check this example:<br>
&gt; <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>
&gt;<br>
&gt; Regards,<br>
&gt; Fred<br>
&gt;<br>
&gt; On Tue, Sep 12, 2017 at 11:49 AM, Matthias Leopold<br>
&gt; &lt;<a href="mailto:matthias.leopold@meduniwien.ac.at" target="_blank">matthias.leopold@meduniwien.ac.at</a><br>
&gt; &lt;mailto:<a href="mailto:matthias.leopold@meduniwien.ac.at" target="_blank">matthias.leopold@meduniwien.ac.at</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Hi,<br>
&gt;<br>
&gt;     is there a way to upload disk images (not OVF files, not ISO files)<br>
&gt;     to oVirt storage domains via CLI? I need to upload a 800GB file and<br>
&gt;     this is not really comfortable via browser. I looked at ovirt-shell<br>
&gt;     and<br>
&gt;     <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>
&gt;     &lt;<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>&gt;,<br>
&gt;     but i didn&#39;t find an option in either of them.<br>
&gt;<br>
&gt;     thx<br>
&gt;     matthias<br>
&gt;<br>
&gt;     _______________________________________________<br>
&gt;     Users mailing list<br>
&gt;     <a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a> &lt;mailto:<a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a>&gt;<br>
&gt;     <a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
&gt;     &lt;<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a>&gt;<br>
&gt;<br>
&gt;<br>
<br>
--<br>
Matthias Leopold<br>
IT Systems &amp; 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>