[Engine-devel] Floating Disks implementation in REST-API

Livnat Peer lpeer at redhat.com
Wed Apr 18 10:38:23 UTC 2012


On 17/04/12 19:31, Geert Jansen wrote:
> 
> On 04/17/2012 05:54 PM, Itamar Heim wrote:
> 
>>> If we can expose the "shared" flag though, i think the API gets more
>>> natural. We can then only show the shared disks in the root context.
>>>
>>> Itamar, can we expose this flag, or do you consider this flag is
>>> internal to the BE?
>>
>> we have to expose this flag for shared disk functionality. this is the
>> only way via ui/api to flag the disk as shared (which only then allows
>> attaching it to more than a single vm - this is explicit to avoid disk
>> corruptions)
> 
> OK, understood.
> 
> Which then begs the question - why we are trying to make the setting /
> unsetting of this flag implicit via the various POST and DELETE calls we
> were trying to model.
> 
> Maybe we ought to just allow a user to set the shared flag:
> 
>  PUT /api/vms/{vm:id}/disks/{disk:id}
>  <disk>
>   <shared>true|false</shared>
>  </disk>
> 
> When a disk is shared:
> 
>  - The disks shows up in the root context /api/disks.
>  - You can POST this disk to another VM, making it available to that VM.
>  - Detach it from a VM using DELETE.
> 
> To delete a shared disk, you need to either:
> 
>  - Unshare it first. Then DELETE.
>  - DELETE it from the root context.
> 
> Regards,
> Geert

Hi Geert,

UIUC we are trying to model two backend commands:

- attach disk to VM
- detach disk from VM

If the disk property 'shareable' is checked it means the user can attach
the disk to more than one VM, but the question is how the user does that
(regardless if the disk is attached to other VMs or not).

My understanding is that the root disks collections includes all disks
in the setup (floating and attached) and the /api/vms/{vm:id}/disks/
includes all disks attached to the VM (can be disk that is attached to
more than this VM, or only to this VM).

Livnat





> _______________________________________________
> Engine-devel mailing list
> Engine-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel




More information about the Devel mailing list