API how to increase extend resize disk VM

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-vir... PUT /api/vms/{VM_ID}/disks/{DISK_ID} HTTP/1.1 Accept: application/xml Content-type: application/xml <disk> <size>{NEW_SIZE_IN_BYTES}</size> </disk> Thanks for advice.

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-vir... PUT /api/vms/{VM_ID}/disks/{DISK_ID} HTTP/1.1 Accept: application/xml Content-type: application/xml <disk> <size>{NEW_SIZE_IN_BYTES}</size> </disk> Thanks for advice. _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@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/EBIMZ4GMNOYANX...

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: <disk> <qcow_version>qcow2_v3</qcow_version> </disk> 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: <disk> <provisioned_size>18737418240</provisioned_size> </disk>

This is informations from apidoc https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/htm... Here is example: <disk> <qcow_version>qcow2_v3</qcow_version> </disk> But this not working if i change to this: <disk> <size>{{ new size > actual size }}</size> </disk> OR <disk> <provisioned_size>{{ new size > actual size }}</provisioned_size> </disk> I get this error: I have HTTP Error 400: Bad Request Request syntactically incorrect. But syntax is OK:

On Tuesday, 5 October 2021 09:47:45 CEST ovirt.org@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/htm...
Here is example:
<disk> <qcow_version>qcow2_v3</qcow_version> </disk>
But this not working if i change to this:
<disk> <size>{{ new size > actual size }}</size> </disk>
OR
<disk> <provisioned_size>{{ new size > actual size }}</provisioned_size> </disk>
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-leave@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/

But for me there is no element for the value of space. It looks something like this: <disk_attachment href="/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b85925575f/diskattachments/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc" id="f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc"> <active>true</active> <bootable>true</bootable> <interface>virtio_scsi</interface> <pass_discard>false</pass_discard> <read_only>false</read_only> <uses_scsi_reservation>false</uses_scsi_reservation> <disk href="/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc" id="f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc"/> <vm href="/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b85925575f" id="678faf6f-fa5f-4785-a365-e1b85925575f"/> </disk_attachment> So is it not possible to increase extend space using the API in ovirt?

On Tuesday, 5 October 2021 15:44:40 CEST ovirt.org@nevim.eu wrote:
But for me there is no element for the value of space. It looks something like this:
<disk_attachment href="/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b85925575f/diskattach ments/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc" id="f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc"> <active>true</active> <bootable>true</bootable> <interface>virtio_scsi</interface> <pass_discard>false</pass_discard> <read_only>false</read_only> <uses_scsi_reservation>false</uses_scsi_reservation> <disk href="/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc" id="f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc"/> <vm href="/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b85925575f" id="678faf6f-fa5f-4785-a365-e1b85925575f"/> </disk_attachment>
So is it not possible to increase extend space using the API in ovirt?
<provisioned_size> should do the job, try to use XML snippet from https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/htm...

I try this: PUT https://ovirt.domain.com/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b859... <disk_attachment> <bootable>true</bootable> <active>true</active> <disk> <provisioned_size>30737418240</provisioned_size> </disk> </disk_attachment> I recieve: Request syntactically incorrect. Status code was 400 and not [200]: HTTP Error 400: Bad Request

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/upd... 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-a63d... Is there some more info on the engine log? *Regards,* *Shani Leviim* On Tue, Oct 5, 2021 at 10:05 PM <ovirt.org@nevim.eu> wrote:
I try this: PUT https://ovirt.domain.com/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b859...
<disk_attachment> <bootable>true</bootable> <active>true</active> <disk> <provisioned_size>30737418240</provisioned_size> </disk> </disk_attachment>
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-leave@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/PUFVAU7GGOZ4ZM...

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-a63... Result #2: <disk href="/ovirt-engine/api/disks/1e0a39c1-08d5-41b1-8e4e-5174597c59c9" id="1e0a39c1-08d5-41b1-8e4e-5174597c59c9"> .... <propagate_errors>false</propagate_errors> <provisioned_size>107374182400</provisioned_size> <qcow_version>qcow2_v3</qcow_version> <shareable>false</shareable> <sparse>true</sparse> <status>ok</status> <storage_type>image</storage_type> <total_size>20090257408</total_size> ... </disk> No i try #2: PUT https://ovirt2.domain.com/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a63... <disk> <provisioned_size>30737418240</provisioned_size> </disk> Result #2: "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<fault>\n <detail>Updating disk attributes other than QCOW version is permitted only for disk-attachments, which reside under VMs.</detail>\n <reason>Operation Failed</reason>\n</fault>\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-a63...", 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?

On Wednesday, 6 October 2021 15:14:10 CEST ovirt.org@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: <disk href="/ovirt-engine/api/disks/1e0a39c1-08d5-41b1-8e4e-5174597c59c9" id="1e0a39c1-08d5-41b1-8e4e-5174597c59c9"> .... <propagate_errors>false</propagate_errors> <provisioned_size>107374182400</provisioned_size> <qcow_version>qcow2_v3</qcow_version> <shareable>false</shareable> <sparse>true</sparse> <status>ok</status> <storage_type>image</storage_type> <total_size>20090257408</total_size> ... </disk>
No i try #2: PUT https://ovirt2.domain.com/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a6 3d8db5c2cc <disk> <provisioned_size>30737418240</provisioned_size> </disk>
Result #2: "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<fault>\n <detail>Updating disk attributes other than QCOW version is permitted only for disk-attachments, which reside under VMs.</detail>\n <reason>Operation Failed</reason>\n</fault>\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): <disk_attachment> <disk> <provisioned_size>2147483648</provisioned_size> </disk> </disk_attachment> 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-ef126...

although I don't see the elements there via GET, it really works, Thanks a lot. Karma +1 :-)

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 <http://ovirt.github.io/ovirt-engine-api-model/4.3/#services/disk> and Disk_Attachment <http://ovirt.github.io/ovirt-engine-api-model/4.3/#services/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-fl... 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: <disk_attachment href="/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b85925575f/diskattachments/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc" id="f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc"> <active>true</active> <bootable>true</bootable> <interface>virtio_scsi</interface> <pass_discard>false</pass_discard> <read_only>false</read_only> <uses_scsi_reservation>false</uses_scsi_reservation> *<disk href="/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc" id="f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc"/>* <vm href="/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b85925575f" id="678faf6f-fa5f-4785-a365-e1b85925575f"/> </disk_attachment> 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: <disk href="/ovirt-engine/api/disks/f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc" id="f770c0d1-dd0d-40a8-a69a-a63d8db5c2cc"> <actions> ... </actions> <name>your-disk-name</name> <description></description> <vms> <vm href="/ovirt-engine/api/vms/678faf6f-fa5f-4785-a365-e1b85925575f" id="678faf6f-fa5f-4785-a365-e1b85925575f"/> </vms> <provisioned_size>2147483648</provisioned_size> <shareable>false</shareable> <status>ok</status> <storage_domains> ... </storage_domains> </disk> Here, you can see the disk's parameters. So actually, by sending an update request of the form: <disk_attachment> <disk> <provisioned_size>2147483648</provisioned_size> </disk> </disk_attachment> 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 <ovirt.org@nevim.eu> 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-leave@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/Y6554EC3FP45EV...

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.
participants (5)
-
ovirt.org@nevim.eu
-
Shani Leviim
-
Strahil Nikolov
-
sultanu@inbox.ru
-
Vojtech Juranek