<div dir="ltr">Shit, I got it. Sorry<div><br></div><div>The problem is that I was accessing to the v4 disk-attachment id and I was getting everything quite messed up. I was doing all of this while creating a machine, so I was trying to rename the disk at the same time it&#39;s being created.</div><div><br></div><div>I&#39;ll delete all the &quot;if ($ovirt_major == 3)&quot; I have in my code. If I have any problem I&#39;ll let you know.</div><div><br></div><div>Thank you </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 28, 2017 at 1:03 PM, Juan Hernández <span dir="ltr">&lt;<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 06/28/2017 12:55 PM, Bruno Rodriguez wrote:<br>
&gt; I&#39;m sorry about bothering you again, but after trying it some times I&#39;m<br>
&gt; still getting a &quot;500 Internal Server Error&quot;. I&#39;m using a REST client<br>
&gt; instead of CURL and I tried adding a &quot;Version: 3&quot; to headers and used<br>
&gt; the URL with the v3 as well.<br>
&gt;<br>
&gt; I&#39;m issuing a PUT of<br>
&gt;<br>
&gt; &lt;disk&gt;&lt;alias&gt;Alias_for_disk&lt;/<wbr>alias&gt;&lt;/disk&gt;<br>
&gt;<br>
&gt; To the URL<br>
&gt;<br>
&gt; <a href="https://myserver/ovirt-engine/api/v3/vms/62498f51-0203-48b9-83c8-4c6f3bdfe05c/disks/583ed952-46a8-4bc5-8a27-8660e4a24ea2" rel="noreferrer" target="_blank">https://myserver/ovirt-engine/<wbr>api/v3/vms/62498f51-0203-48b9-<wbr>83c8-4c6f3bdfe05c/disks/<wbr>583ed952-46a8-4bc5-8a27-<wbr>8660e4a24ea2</a><br>
&gt;<br>
&gt; I mean, I can live without it but we are using oVirt as a &quot;static<br>
&gt; virtualization&quot; environment and is quite useful for us being able to<br>
&gt; recognize easily each disk by its server name. In case I have to wait<br>
&gt; until the 4.2 API version to automatize this I&#39;ll do :(<br>
&gt;<br>
<br>
</span>That should work. Can you please check if you get any useful message in<br>
/var/log/ovirt-engine/server.<wbr>log or /var/log/ovirt-engine/engine.<wbr>log?<br>
<span class=""><br>
&gt;<br>
&gt;<br>
&gt; On Wed, Jun 28, 2017 at 11:18 AM, Bruno Rodriguez &lt;<a href="mailto:bruno@pic.es">bruno@pic.es</a><br>
</span><span class="">&gt; &lt;mailto:<a href="mailto:bruno@pic.es">bruno@pic.es</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Thank you very much !!!<br>
&gt;<br>
&gt;     I expected I was missing something like that. Thanks again!<br>
&gt;<br>
&gt;     On Wed, Jun 28, 2017 at 11:12 AM, Juan Hernández<br>
</span><div><div class="h5">&gt;     &lt;<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> &lt;mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;         On 06/28/2017 10:43 AM, Bruno Rodriguez wrote:<br>
&gt;         &gt; Thank you, Daniel<br>
&gt;         &gt;<br>
&gt;         &gt; I tried a PUT with the same XML body, I got a &quot;405 Method Not Allowed&quot;.<br>
&gt;         &gt; It&#39;s quite strange, there must be someting I&#39;m missing<br>
&gt;         &gt;<br>
&gt;<br>
&gt;         The operation to update a disk will be introduced in version 4<br>
&gt;         of the<br>
&gt;         API with version 4.2 of the engine. Meanwhile the way to update<br>
&gt;         the disk<br>
&gt;         is to use version 3 of the API and the disks sub-collection of the<br>
&gt;         virtual machine. That means that if you have a VM with id 123<br>
&gt;         and a disk<br>
&gt;         with id 456 you can send a request like this:<br>
&gt;<br>
&gt;           PUT /ovirt-engine/api/v3/vms/123/<wbr>disks/456<br>
&gt;<br>
&gt;         With a request body like this:<br>
&gt;<br>
&gt;           &lt;disk&gt;<br>
&gt;             &lt;alias&gt;newalias&lt;/alias&gt;<br>
&gt;           &lt;/disk&gt;<br>
&gt;<br>
&gt;         Note that you can use the above &quot;v3&quot; prefix in the URL or else the<br>
&gt;         &quot;Version: 3&quot; header. A complete example using curl:<br>
&gt;<br>
&gt;         ---8&lt;---<br>
&gt;         #!/bin/bash -ex<br>
&gt;<br>
&gt;         url=&quot;https://.../ovirt-engine/<wbr>api&quot;<br>
&gt;         user=&quot;admin@internal&quot;<br>
&gt;         password=&quot;...&quot;<br>
&gt;         vm_id=&quot;...&quot;<br>
&gt;         disk_id=&quot;...&quot;<br>
&gt;<br>
&gt;         curl \<br>
&gt;         --verbose \<br>
&gt;         --cacert &quot;ca.pem&quot; \<br>
&gt;         --header &quot;Version: 3&quot; \<br>
&gt;         --header &quot;Content-Type: application/xml&quot; \<br>
&gt;         --user &quot;${user}:${password}&quot; \<br>
&gt;         --request PUT \<br>
&gt;         --data &quot;<br>
&gt;         &lt;disk&gt;<br>
&gt;           &lt;alias&gt;newalias&lt;/alias&gt;<br>
&gt;         &lt;/disk&gt;<br>
&gt;         &quot; \<br>
&gt;         &quot;${url}/vms/${vm_id}/disks/${<wbr>disk_id}&quot;<br>
&gt;         ---&gt;8---<br>
&gt;<br>
&gt;         &gt;<br>
&gt;         &gt; On Wed, Jun 28, 2017 at 10:07 AM, Daniel Erez &lt;<a href="mailto:derez@redhat.com">derez@redhat.com</a> &lt;mailto:<a href="mailto:derez@redhat.com">derez@redhat.com</a>&gt;<br>
</div></div><span class="">&gt;         &gt; &lt;mailto:<a href="mailto:derez@redhat.com">derez@redhat.com</a> &lt;mailto:<a href="mailto:derez@redhat.com">derez@redhat.com</a>&gt;&gt;&gt; wrote:<br>
&gt;         &gt;<br>
&gt;         &gt;     Hi,<br>
&gt;         &gt;<br>
&gt;         &gt;     Updating is done using the PUT method.<br>
&gt;         &gt;     Please try that with the same XML body.<br>
&gt;         &gt;<br>
&gt;         &gt;     Thanks,<br>
&gt;         &gt;     Daniel<br>
&gt;         &gt;<br>
&gt;         &gt;     On Wed, Jun 28, 2017 at 10:26 AM Bruno Rodriguez &lt;<a href="mailto:bruno@pic.es">bruno@pic.es</a> &lt;mailto:<a href="mailto:bruno@pic.es">bruno@pic.es</a>&gt;<br>
</span><div><div class="h5">&gt;         &gt;     &lt;mailto:<a href="mailto:bruno@pic.es">bruno@pic.es</a> &lt;mailto:<a href="mailto:bruno@pic.es">bruno@pic.es</a>&gt;&gt;&gt; wrote:<br>
&gt;         &gt;<br>
&gt;         &gt;         Hello everyone,<br>
&gt;         &gt;<br>
&gt;         &gt;         I&#39;m having some problems about renaming some disks (setting a<br>
&gt;         &gt;         different alias, name or description) for VMs disks created from<br>
&gt;         &gt;         a template. When I get this URL<br>
&gt;         &gt;<br>
&gt;         &gt;         <a href="https://ovirt-manager/ovirt-engine/api/disks/0123" rel="noreferrer" target="_blank">https://ovirt-manager/ovirt-<wbr>engine/api/disks/0123</a><br>
&gt;         &lt;<a href="https://ovirt-manager/ovirt-engine/api/disks/0123" rel="noreferrer" target="_blank">https://ovirt-manager/ovirt-<wbr>engine/api/disks/0123</a>&gt;<br>
&gt;         &gt;         &lt;<a href="https://ovirt-manager/ovirt-engine/api/disks/0123" rel="noreferrer" target="_blank">https://ovirt-manager/ovirt-<wbr>engine/api/disks/0123</a><br>
&gt;         &lt;<a href="https://ovirt-manager/ovirt-engine/api/disks/0123" rel="noreferrer" target="_blank">https://ovirt-manager/ovirt-<wbr>engine/api/disks/0123</a>&gt;&gt;<br>
&gt;         &gt;<br>
&gt;         &gt;         I can see are the methods sparsify, export, move and copy. I<br>
&gt;         &gt;         tried to POST the following XML to the previous URL with no<br>
&gt;         &gt;         result (as expected, it won&#39;t work)<br>
&gt;         &gt;<br>
&gt;         &gt;         &lt;disk&gt;<br>
&gt;         &gt;           &lt;alias&gt;my_machine_Disk1&lt;/<wbr>alias&gt;<br>
&gt;         &gt;         &lt;/disk&gt;<br>
&gt;         &gt;<br>
&gt;         &gt;         I&#39;m quite sure I&#39;m thinking about it in a wrong way (as usual).<br>
&gt;         &gt;         Any help would be welcome...<br>
&gt;         &gt;<br>
&gt;         &gt;         Thank you in advance<br>
&gt;         &gt;<br>
&gt;         &gt;         --<br>
&gt;         &gt;         Bruno Rodríguez Rodríguez<br>
&gt;         &gt;<br>
&gt;         &gt;         *Port d&#39;Informació Científica (PIC)*<br>
&gt;         &gt;<br>
&gt;         &gt;         ______________________________<wbr>_________________<br>
&gt;         &gt;         Users mailing list<br>
&gt;         &gt;         <a href="mailto:Users@ovirt.org">Users@ovirt.org</a> &lt;mailto:<a href="mailto:Users@ovirt.org">Users@ovirt.org</a>&gt;<br>
</div></div>&gt;         &lt;mailto:<a href="mailto:Users@ovirt.org">Users@ovirt.org</a> &lt;mailto:<a href="mailto:Users@ovirt.org">Users@ovirt.org</a>&gt;&gt;<br>
<span class="">&gt;         &gt;         <a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a><br>
&gt;         &lt;<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a>&gt;<br>
&gt;         &gt;         &lt;<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a><br>
&gt;         &lt;<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a>&gt;&gt;<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; --<br>
&gt;         &gt; Bruno Rodríguez Rodríguez<br>
&gt;         &gt;<br>
&gt;         &gt; *Port d&#39;Informació Científica (PIC)*<br>
&gt;         &gt; Campus UAB - Edificio D,<br>
&gt;         &gt; C / Albareda, s / n<br>
&gt;         &gt; 08193-Bellaterra (Barcelona), España<br>
</span>&gt;         &gt; Telf. <a href="tel:%2B34%2093%20170%2027%2030" value="+34931702730">+34 93 170 27 30</a> &lt;tel:%2B34%2093%20170%2027%<wbr>2030&gt;<br>
<div class="HOEnZb"><div class="h5">&gt;         &gt; GPS  coordenadas:  41.500850 2.110628<br>
&gt;         &gt;<br>
&gt;         &gt; &quot;Si algo me ha enseñado el tetris, es que los errores se acumulan y los<br>
&gt;         &gt; triunfos desaparecen&quot;<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; ______________________________<wbr>_________________<br>
&gt;         &gt; Users mailing list<br>
&gt;         &gt; <a href="mailto:Users@ovirt.org">Users@ovirt.org</a> &lt;mailto:<a href="mailto:Users@ovirt.org">Users@ovirt.org</a>&gt;<br>
&gt;         &gt; <a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a><br>
&gt;         &lt;<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a>&gt;<br>
&gt;         &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;     --<br>
&gt;     Bruno Rodríguez Rodríguez<br>
&gt;<br>
&gt;     *Port d&#39;Informació Científica (PIC)*<br>
&gt;     Campus UAB - Edificio D,<br>
&gt;     C / Albareda, s / n<br>
&gt;     08193-Bellaterra (Barcelona), España<br>
&gt;     Telf. <a href="tel:%2B34%2093%20170%2027%2030" value="+34931702730">+34 93 170 27 30</a><br>
&gt;     GPS  coordenadas:  41.500850 2.110628<br>
&gt;<br>
&gt;     &quot;Si algo me ha enseñado el tetris, es que los errores se acumulan y<br>
&gt;     los triunfos desaparecen&quot;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Bruno Rodríguez Rodríguez<br>
&gt;<br>
&gt; *Port d&#39;Informació Científica (PIC)*<br>
&gt; Campus UAB - Edificio D,<br>
&gt; C / Albareda, s / n<br>
&gt; 08193-Bellaterra (Barcelona), España<br>
&gt; Telf. <a href="tel:%2B34%2093%20170%2027%2030" value="+34931702730">+34 93 170 27 30</a><br>
&gt; GPS  coordenadas:  41.500850 2.110628<br>
&gt;<br>
&gt; &quot;Si algo me ha enseñado el tetris, es que los errores se acumulan y los<br>
&gt; triunfos desaparecen&quot;<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="text-align:left;font-family:Arial,Tahoma,Helvetica,FreeSans,sans-serif;line-height:20px;background-color:rgb(255,255,255)"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;line-height:normal">Bruno Rodríguez Rodríguez</span></div><div style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br><div dir="ltr" style="color:rgb(34,34,34);font-size:12.8px"><font color="#444444"><b>Port d&#39;Informació Científica (PIC)</b></font>             <br>Campus UAB - Edificio D,</div><div dir="ltr" style="color:rgb(34,34,34);font-size:12.8px">C / <span>Albareda</span>, s / n <br>08193-Bellaterra (Barcelona), España</div><div style="color:rgb(34,34,34);font-size:12.8px"><a value="+34935813322" style="color:rgb(17,85,204);font-size:13px">Telf. +34 93 170 27 30</a><br></div><div dir="ltr" style="color:rgb(34,34,34);font-size:12.8px"><font color="#0000ff">GPS </font> coordenadas:  <span style="font-size:12.8px">41.500850 2.110628</span></div></div><div><a value="+34935813322" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></a></div><div><a value="+34935813322" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="color:rgb(0,0,0);font-family:Arial,Tahoma,Helvetica,FreeSans,sans-serif;font-size:small;line-height:20px">&quot;Si algo me ha enseñado el tetris, es que los errores se acumulan y los triunfos desaparecen&quot;</span></a></div></div></div></div></div></div></div>
</div>