<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's being created.</div><div><br></div><div>I'll delete all the "if ($ovirt_major == 3)" I have in my code. If I have any problem I'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"><<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>></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>
> I'm sorry about bothering you again, but after trying it some times I'm<br>
> still getting a "500 Internal Server Error". I'm using a REST client<br>
> instead of CURL and I tried adding a "Version: 3" to headers and used<br>
> the URL with the v3 as well.<br>
><br>
> I'm issuing a PUT of<br>
><br>
> <disk><alias>Alias_for_disk</<wbr>alias></disk><br>
><br>
> To the URL<br>
><br>
> <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>
><br>
> I mean, I can live without it but we are using oVirt as a "static<br>
> virtualization" environment and is quite useful for us being able to<br>
> recognize easily each disk by its server name. In case I have to wait<br>
> until the 4.2 API version to automatize this I'll do :(<br>
><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>
><br>
><br>
> On Wed, Jun 28, 2017 at 11:18 AM, Bruno Rodriguez <<a href="mailto:bruno@pic.es">bruno@pic.es</a><br>
</span><span class="">> <mailto:<a href="mailto:bruno@pic.es">bruno@pic.es</a>>> wrote:<br>
><br>
> Thank you very much !!!<br>
><br>
> I expected I was missing something like that. Thanks again!<br>
><br>
> On Wed, Jun 28, 2017 at 11:12 AM, Juan Hernández<br>
</span><div><div class="h5">> <<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a> <mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>>> wrote:<br>
><br>
> On 06/28/2017 10:43 AM, Bruno Rodriguez wrote:<br>
> > Thank you, Daniel<br>
> ><br>
> > I tried a PUT with the same XML body, I got a "405 Method Not Allowed".<br>
> > It's quite strange, there must be someting I'm missing<br>
> ><br>
><br>
> The operation to update a disk will be introduced in version 4<br>
> of the<br>
> API with version 4.2 of the engine. Meanwhile the way to update<br>
> the disk<br>
> is to use version 3 of the API and the disks sub-collection of the<br>
> virtual machine. That means that if you have a VM with id 123<br>
> and a disk<br>
> with id 456 you can send a request like this:<br>
><br>
> PUT /ovirt-engine/api/v3/vms/123/<wbr>disks/456<br>
><br>
> With a request body like this:<br>
><br>
> <disk><br>
> <alias>newalias</alias><br>
> </disk><br>
><br>
> Note that you can use the above "v3" prefix in the URL or else the<br>
> "Version: 3" header. A complete example using curl:<br>
><br>
> ---8<---<br>
> #!/bin/bash -ex<br>
><br>
> url="https://.../ovirt-engine/<wbr>api"<br>
> user="admin@internal"<br>
> password="..."<br>
> vm_id="..."<br>
> disk_id="..."<br>
><br>
> curl \<br>
> --verbose \<br>
> --cacert "ca.pem" \<br>
> --header "Version: 3" \<br>
> --header "Content-Type: application/xml" \<br>
> --user "${user}:${password}" \<br>
> --request PUT \<br>
> --data "<br>
> <disk><br>
> <alias>newalias</alias><br>
> </disk><br>
> " \<br>
> "${url}/vms/${vm_id}/disks/${<wbr>disk_id}"<br>
> --->8---<br>
><br>
> ><br>
> > On Wed, Jun 28, 2017 at 10:07 AM, Daniel Erez <<a href="mailto:derez@redhat.com">derez@redhat.com</a> <mailto:<a href="mailto:derez@redhat.com">derez@redhat.com</a>><br>
</div></div><span class="">> > <mailto:<a href="mailto:derez@redhat.com">derez@redhat.com</a> <mailto:<a href="mailto:derez@redhat.com">derez@redhat.com</a>>>> wrote:<br>
> ><br>
> > Hi,<br>
> ><br>
> > Updating is done using the PUT method.<br>
> > Please try that with the same XML body.<br>
> ><br>
> > Thanks,<br>
> > Daniel<br>
> ><br>
> > On Wed, Jun 28, 2017 at 10:26 AM Bruno Rodriguez <<a href="mailto:bruno@pic.es">bruno@pic.es</a> <mailto:<a href="mailto:bruno@pic.es">bruno@pic.es</a>><br>
</span><div><div class="h5">> > <mailto:<a href="mailto:bruno@pic.es">bruno@pic.es</a> <mailto:<a href="mailto:bruno@pic.es">bruno@pic.es</a>>>> wrote:<br>
> ><br>
> > Hello everyone,<br>
> ><br>
> > I'm having some problems about renaming some disks (setting a<br>
> > different alias, name or description) for VMs disks created from<br>
> > a template. When I get this URL<br>
> ><br>
> > <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>
> <<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>
> > <<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>
> <<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>
> ><br>
> > I can see are the methods sparsify, export, move and copy. I<br>
> > tried to POST the following XML to the previous URL with no<br>
> > result (as expected, it won't work)<br>
> ><br>
> > <disk><br>
> > <alias>my_machine_Disk1</<wbr>alias><br>
> > </disk><br>
> ><br>
> > I'm quite sure I'm thinking about it in a wrong way (as usual).<br>
> > Any help would be welcome...<br>
> ><br>
> > Thank you in advance<br>
> ><br>
> > --<br>
> > Bruno Rodríguez Rodríguez<br>
> ><br>
> > *Port d'Informació Científica (PIC)*<br>
> ><br>
> > ______________________________<wbr>_________________<br>
> > Users mailing list<br>
> > <a href="mailto:Users@ovirt.org">Users@ovirt.org</a> <mailto:<a href="mailto:Users@ovirt.org">Users@ovirt.org</a>><br>
</div></div>> <mailto:<a href="mailto:Users@ovirt.org">Users@ovirt.org</a> <mailto:<a href="mailto:Users@ovirt.org">Users@ovirt.org</a>>><br>
<span class="">> > <a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a><br>
> <<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a>><br>
> > <<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a><br>
> <<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a>>><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Bruno Rodríguez Rodríguez<br>
> ><br>
> > *Port d'Informació Científica (PIC)*<br>
> > Campus UAB - Edificio D,<br>
> > C / Albareda, s / n<br>
> > 08193-Bellaterra (Barcelona), España<br>
</span>> > Telf. <a href="tel:%2B34%2093%20170%2027%2030" value="+34931702730">+34 93 170 27 30</a> <tel:%2B34%2093%20170%2027%<wbr>2030><br>
<div class="HOEnZb"><div class="h5">> > GPS coordenadas: 41.500850 2.110628<br>
> ><br>
> > "Si algo me ha enseñado el tetris, es que los errores se acumulan y los<br>
> > triunfos desaparecen"<br>
> ><br>
> ><br>
> > ______________________________<wbr>_________________<br>
> > Users mailing list<br>
> > <a href="mailto:Users@ovirt.org">Users@ovirt.org</a> <mailto:<a href="mailto:Users@ovirt.org">Users@ovirt.org</a>><br>
> > <a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a><br>
> <<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/<wbr>mailman/listinfo/users</a>><br>
> ><br>
><br>
><br>
><br>
><br>
> --<br>
> Bruno Rodríguez Rodríguez<br>
><br>
> *Port d'Informació Científica (PIC)*<br>
> Campus UAB - Edificio D,<br>
> C / Albareda, s / n<br>
> 08193-Bellaterra (Barcelona), España<br>
> Telf. <a href="tel:%2B34%2093%20170%2027%2030" value="+34931702730">+34 93 170 27 30</a><br>
> GPS coordenadas: 41.500850 2.110628<br>
><br>
> "Si algo me ha enseñado el tetris, es que los errores se acumulan y<br>
> los triunfos desaparecen"<br>
><br>
><br>
><br>
><br>
> --<br>
> Bruno Rodríguez Rodríguez<br>
><br>
> *Port d'Informació Científica (PIC)*<br>
> Campus UAB - Edificio D,<br>
> C / Albareda, s / n<br>
> 08193-Bellaterra (Barcelona), España<br>
> Telf. <a href="tel:%2B34%2093%20170%2027%2030" value="+34931702730">+34 93 170 27 30</a><br>
> GPS coordenadas: 41.500850 2.110628<br>
><br>
> "Si algo me ha enseñado el tetris, es que los errores se acumulan y los<br>
> triunfos desaparecen"<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'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">"Si algo me ha enseñado el tetris, es que los errores se acumulan y los triunfos desaparecen"</span></a></div></div></div></div></div></div></div>
</div>