[ovirt-users] Re: API how to increase extend resize disk VM

2022-06-25 Thread sultanu--- via Users
Hello, team!
Is it possible to change Actual size on cow disk from API? In our 
infrastructure we have 3 host cluster + ISCSI storage, i need increase disk 
size for uploading cow image from API.   
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/XJ6B6BQ7AGSBFT3KICRG2FNTZIGD57YN/


[ovirt-users] Re: API how to increase extend resize disk VM

2021-10-07 Thread Shani Leviim
Glad it worked :)

I'll try to fill the gap, so maybe things will make more sense.

The API you dealt with has 2 basic services - Disk
 and
Disk_Attachment

.
In 4.3, once you're interested in a disk attached to a VM, the service you
need to use is *disk_attachment*.
(So the GET, PUT POST refers to the disk_attachment service).
Basically, in order to edit a disk (any disk), you need to attach it to a
VM (any VM), and only then update its parameters (name, interface, size,
etc).
Even if you want to edit a floating disk (a disk you've just created and
wants to change its name for instance), you need to attach it to a VM, edit
its name and then detach it from the VM back, so it will be floating again.

In 4.4, we've changed that behavior, so editing disks will be available
also for floating disks
https://www.ovirt.org/develop/release-management/features/storage/editing-floating-disks.html
That means that you can edit the disk "as disk", not necessarily attached
to a VM, and use the *disk* service.

So in your case, the service you need to use in order to update is
disk_attachment.

Now, regarding the provisioned_size field, on your GET request, you've
received the following response:


true
true
virtio_scsi
false
false
false
**



This means that the disk_attachment, the disk that attached to your VM,
also has a reference to the disk itself "as a disk".
By sending a GET request for
*/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc*, you'll get
a response of the following form:


...

your-disk-name




2147483648
false
ok

...



Here, you can see the disk's parameters.
So actually, by sending an update request of the form:

  
2147483648
  


Means something like "go to the disk attachment of my VM, and update the
disk elements with the following fields and values".

Hope it makes more sense.


*Regards,*

*Shani Leviim*


On Thu, Oct 7, 2021 at 9:27 AM  wrote:

> although I don't see the elements there via GET, it really works, Thanks a
> lot. Karma +1 :-)
> ___
> Users mailing list -- users@ovirt.org
> To unsubscribe send an email to users-le...@ovirt.org
> Privacy Statement: https://www.ovirt.org/privacy-policy.html
> oVirt Code of Conduct:
> https://www.ovirt.org/community/about/community-guidelines/
> List Archives:
> https://lists.ovirt.org/archives/list/users@ovirt.org/message/Y6554EC3FP45EVZ7NUTKUFETOJRDV5NB/
>
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/7AF6WF45AYLE7KGAOMDMZ7TJHS47QOCY/


[ovirt-users] Re: API how to increase extend resize disk VM

2021-10-07 Thread ovirt . org
although I don't see the elements there via GET, it really works, Thanks a lot. 
Karma +1 :-)
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/Y6554EC3FP45EVZ7NUTKUFETOJRDV5NB/


[ovirt-users] Re: API how to increase extend resize disk VM

2021-10-06 Thread Vojtech Juranek
On Wednesday, 6 October 2021 15:14:10 CEST ovirt@nevim.eu wrote:
> ovirt.domain.com: Software Version:4.3.4.3-1.el7
> ovirt2.domain.com: Software Version:4.3.10.4-1.el7
> 
> I test everything on the server ovirt2.domains.com.
> 
> No i try #1:
> GET
> https://ovirt2.domain.com/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a6
> 3d8db5c2cc
 
> Result #2:
>  id="1e0a39c1-08d5-41b1-8e4e-5174597c59c9">
 
> false
> 107374182400
> qcow2_v3
> false
> true
> ok
> image
> 20090257408
> ...
> 
> 
> No i try #2:
> PUT
> https://ovirt2.domain.com/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a6
> 3d8db5c2cc
 
>   30737418240
> 
> 
> Result #2:   
> "content": " standalone=\"yes\"?>\n\nUpdating disk attributes other
> than QCOW version is permitted only for disk-attachments, which reside
> under VMs.\nOperation Failed\n\n",
> "msg": "Status code was 409 and not [200]: HTTP Error 409: Conflict",
> "url":
> "https://ovirt2.domain.com/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a
> 63d8db5c2cc", 
> So version 4.3 really has no way to adjust the disk size via the API? The
> only way is to upgrade to 4.4?

It does, but the disk has t be attached to a VM (Vm don't has to be running).
Example XML (extend.xml):


  
2147483648
  


Example command using this XML:

curl --insecure -X PUT --header "Accept: application/xml" --header 
"Content-Type: application/xml" --user "admin@internal:ovirt" -T extend.xml 
https://engine-test.local/ovirt-engine/api/vms/651faf06-9dd3-41a5-94f6-ef126a933923/diskattachments/69f96ba5-df7b-46d7-93c1-93e4adf0404b

signature.asc
Description: This is a digitally signed message part.
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/L6YNAFWU5AQEGCQQ76BFY2OXBNEOJEDX/


[ovirt-users] Re: API how to increase extend resize disk VM

2021-10-06 Thread ovirt . org
ovirt.domain.com: Software Version:4.3.4.3-1.el7
ovirt2.domain.com: Software Version:4.3.10.4-1.el7

I test everything on the server ovirt2.domains.com.

No i try #1:
GET 
https://ovirt2.domain.com/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc

Result #2:


false
107374182400
qcow2_v3
false
true
ok
image
20090257408
...


No i try #2:
PUT 
https://ovirt2.domain.com/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc

30737418240


Result #2:   
"content": "\n\nUpdating disk attributes other than 
QCOW version is permitted only for disk-attachments, which reside under 
VMs.\nOperation Failed\n\n",
"msg": "Status code was 409 and not [200]: HTTP Error 409: Conflict",
"url": 
"https://ovirt2.domain.com/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc;,

So version 4.3 really has no way to adjust the disk size via the API? The only 
way is to upgrade to 4.4?
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/IHYRZE4HJIFL7L7CUTFEMZD2VZJVSVWW/


[ovirt-users] Re: API how to increase extend resize disk VM

2021-10-06 Thread Shani Leviim
Hi,
The ability to update a disk and its size was upgraded in 4.4
http://ovirt.github.io/ovirt-engine-api-model/4.4/#services/disk/methods/update
That way, you can edit floating disk parameters, such as extend its size,
without attaching the disk to a VM.

On version 4.3, as already mentioned, the disk should be attached to the VM.
In your case, you can see the disk's size with the following request:
GET
https://ovirt.domain.com/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc

Is there some more info on the engine log?


*Regards,*

*Shani Leviim*


On Tue, Oct 5, 2021 at 10:05 PM  wrote:

> I try this: PUT
> https://ovirt.domain.com/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b85925575f/diskattachments/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc
>
> 
>   true
>   true
>   
> 30737418240
>   
> 
>
> I recieve: Request syntactically incorrect.
> Status code was 400 and not [200]: HTTP Error 400: Bad Request
> ___
> Users mailing list -- users@ovirt.org
> To unsubscribe send an email to users-le...@ovirt.org
> Privacy Statement: https://www.ovirt.org/privacy-policy.html
> oVirt Code of Conduct:
> https://www.ovirt.org/community/about/community-guidelines/
> List Archives:
> https://lists.ovirt.org/archives/list/users@ovirt.org/message/PUFVAU7GGOZ4ZMFMUNDWATAPPSXMKOTE/
>
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/3OHDOVP276OGTR6OAZ2ZS64ZOKRWTNOY/


[ovirt-users] Re: API how to increase extend resize disk VM

2021-10-05 Thread ovirt . org
I try this: PUT 
https://ovirt.domain.com/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b85925575f/diskattachments/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc


  true
  true
  
30737418240
  


I recieve: Request syntactically incorrect. 
Status code was 400 and not [200]: HTTP Error 400: Bad Request
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/PUFVAU7GGOZ4ZMFMUNDWATAPPSXMKOTE/


[ovirt-users] Re: API how to increase extend resize disk VM

2021-10-05 Thread Vojtech Juranek
On Tuesday, 5 October 2021 15:44:40 CEST ovirt@nevim.eu wrote:
> But for me there is no element for the value of space. It looks something
> like this:
 
>  href="/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b85925575f/diskattach
> ments/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc"
> id="f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc">
 true
> true
> virtio_scsi
> false
> false
> false
>  id="f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc"/>
  href="/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b85925575f"
> id="678faf6f-fa5f-4785-a365-e1b85925575f"/> 
> 
> So is it not possible to increase extend space using the API in ovirt?


 should do the job, try to use XML snippet from

https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html-single/rest_api_guide/index#services-disk_attachment-methods-update

signature.asc
Description: This is a digitally signed message part.
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/OGAK4GQK5GG6U6XYQCJCXDPSSKLNPQ6K/


[ovirt-users] Re: API how to increase extend resize disk VM

2021-10-05 Thread ovirt . org
But for me there is no element for the value of space. It looks something like 
this:


true
true
virtio_scsi
false
false
false




So is it not possible to increase extend space using the API in ovirt?
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/BMD7NICA4UUHBRTWOCNY22E3POQUZZLL/


[ovirt-users] Re: API how to increase extend resize disk VM

2021-10-05 Thread Vojtech Juranek
On Tuesday, 5 October 2021 09:47:45 CEST ovirt@nevim.eu wrote:
> This is informations from apidoc
> https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/ht
> ml-single/rest_api_guide/index#services-disk-methods-update

which says
"The only field that can be updated is qcow_version."

I guess you are looking for disk_attachment update, in this manual here:

https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html-single/rest_api_guide/index#services-disk_attachment-methods-update


> Here is example:
> 
> 
>   qcow2_v3
> 
> 
> But this not working if i change to this:
> 
> 
>   {{ new size > actual size }}
> 
> 
> OR
> 
> 
>   {{ new size > actual size }}
> 
> 
> I get this error: I have HTTP Error 400: Bad Request  Request syntactically
> incorrect. But syntax is OK:
> ___
> Users mailing list -- users@ovirt.org
> To unsubscribe send an email to users-le...@ovirt.org
> Privacy Statement: https://www.ovirt.org/privacy-policy.html
> oVirt Code of Conduct:
> https://www.ovirt.org/community/about/community-guidelines/ List Archives:
> https://lists.ovirt.org/archives/list/users@ovirt.org/message/E73S45SOELXWQ
> 3TCHEGLHNSZ55JGQBPL/



signature.asc
Description: This is a digitally signed message part.
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/VCECXIAHC6VRL4V5EKIUE3G734IPDKBL/


[ovirt-users] Re: API how to increase extend resize disk VM

2021-10-05 Thread ovirt . org
This is informations from apidoc 
https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html-single/rest_api_guide/index#services-disk-methods-update

Here is example:


  qcow2_v3


But this not working if i change to this:


  {{ new size > actual size }}


OR


  {{ new size > actual size }}


I get this error: I have HTTP Error 400: Bad Request  Request syntactically 
incorrect. But syntax is OK:
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/E73S45SOELXWQ3TCHEGLHNSZ55JGQBPL/


[ovirt-users] Re: API how to increase extend resize disk VM

2021-10-05 Thread ovirt . org
https://ovirt.mydomains/ovirt-engine/apidoc/#/ is not working (page is blank, 
has ovirt horizontal menu, but content is empty).

You may mean the page 
https://ovirt.mydomains/ovirt-engine/apidoc/#/services/disk/methods/update

It works for me, but the information I see on it seems insufficient (unusable) 
to me:

update

This operation updates the disk with the appropriate parameters. The only field 
that can be updated is qcow_version.

For example, disk update can be done using the following request:

PUT /ovirt-engine/api/disks/123

With a request body like this:


  qcow2_v3


Since the backend operation is asynchronous, the disk element that is returned 
to the user might not be synced with the changed properties.

I have HTTP Error 400: Bad Request  Request syntactically incorrect. But syntax 
is OK:

Ansible:

---

  - name: REST call w XML body 
uri: 
  url: https://ovirt.{{ domain }}/ovirt-engine/api/disks/{{ diskid }}
  user: {{ user }}
  password: {{ password }}
  method: PUT
  validate_certs: no
  headers: 
Content-Type: "application/xml"
  #body_format: raw
  body: "{{lookup('file','put.xml')}}" 
register: result

put.xml:


18737418240

___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/QG2MORLKB3UJ6YQ4ZHW57724PMKWY4FS/


[ovirt-users] Re: API how to increase extend resize disk VM

2021-10-04 Thread Strahil Nikolov via Users
I would check the api guide at https://ovirt.somedomain/ovirt-engine/apidoc/#/
Best Regards,Strahil Nikolov
 
 
Hello, please how to increase extend resize disk of VM?

I can working with ansible or REST API.

Ansible working is here, but i not found manual for update size: 
https://docs.ansible.com/ansible/2.3/ovirt_disks_module.html

On official ovirt documentation i cant found how to update. I found only old 
manual in KB page, but not working on lastest: 
https://www.ovirt.org/develop/release-management/features/storage/online-virtual-drive-resize.html

PUT /api/vms/{VM_ID}/disks/{DISK_ID} HTTP/1.1
Accept: application/xml
Content-type: application/xml

    
        {NEW_SIZE_IN_BYTES}
    

Thanks for advice.
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/EBIMZ4GMNOYANXDAFZPN3YZX7XDQW3KG/
  
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/NGVK2KOFJH2VXON6AC5GF6YQ62BHCLC2/