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_attachme...
.
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...
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(a)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(a)ovirt.org
To unsubscribe send an email to users-leave(a)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/Y6554EC3FP4...