Bug 1412230 - Add REST API for VM leases
Summary: Add REST API for VM leases
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: ovirt-4.1.0-beta
: 4.1.0.2
Assignee: Tal Nisan
QA Contact: Lilach Zitnitski
URL:
Whiteboard:
: 1410320 (view as bug list)
Depends On: 1417439
Blocks: 1317429
TreeView+ depends on / blocked
 
Reported: 2017-01-11 15:06 UTC by Tal Nisan
Modified: 2017-02-15 15:07 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-15 15:07:23 UTC
oVirt Team: Storage
rule-engine: ovirt-4.1+


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 70019 master MERGED Add storage lease to virtual machines and templates 2017-01-16 12:26:17 UTC
oVirt gerrit 70136 master MERGED restapi: Add support for storage leases in virtual machines and templates 2017-01-17 15:35:21 UTC
oVirt gerrit 70558 model_4.1 MERGED Add storage lease to virtual machines and templates 2017-01-16 12:26:44 UTC
oVirt gerrit 70647 master MERGED restapi: Update to model 4.2.3 2017-01-17 13:47:31 UTC
oVirt gerrit 70649 ovirt-engine-4.1 MERGED restapi: Update to model 4.1.28 2017-01-17 13:47:59 UTC
oVirt gerrit 70656 ovirt-engine-4.1 MERGED restapi: Add support for storage leases in virtual machines and templates 2017-01-17 15:35:43 UTC

Description Tal Nisan 2017-01-11 15:06:44 UTC
Description of problem:
Add REST API for the VM leases feature that allows the user to see leases on each VM/template and add or remove leases

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Lilach Zitnitski 2017-01-24 09:14:24 UTC
Tal, how can I create new lease for vm via rest? I couldn't find it in the rest documentation.

Comment 2 Tal Nisan 2017-01-24 09:59:59 UTC
You send a POST/PUT request for the VM with the storage domain id in the lease field, for instance:

<vm>
    <lease>
        <storage_domain id="11be3393-739e-4157-b89f-40c00b4bb2ab"/>
    </lease>
</vm>

Comment 3 Lilach Zitnitski 2017-01-25 12:16:44 UTC
Tal, there are still two issues with the REST API:

1. when creating new lease the lease is created but the high availability option is not updated to enabled 'true'

    <high_availability>
        <enabled>false</enabled>
        <priority>1</priority>
    </high_availability>

…
    <lease>
        <storage_domain href="/ovirt-engine/api/v4/storagedomains/1b67fa07-406c-42bb-b2fb-a5d92ea24c83" id="1b67fa07-406c-42bb-b2fb-a5d92ea24c83"/>
    </lease>

it also affects the gui, and after you create lease without changing the HA option, you can also do that in the gui as well. before that you had you enable first the HA, and while it's disabled the drop down menu is greyed out. 

2. is there an option to delete lease using the REST API?

Comment 4 Tal Nisan 2017-01-26 08:38:13 UTC
For the 1st please open a separate bug an explain there how do you think the behavior should be

As for deleting a lease, you just send an empty one:
    <lease> </lease>

Comment 5 Lilach Zitnitski 2017-02-01 15:40:44 UTC
--------------------------------------
Tested with the following code:
----------------------------------------
rhevm-4.1.0.3-0.1.el7.noarch

Moving to VERIFIED!

Comment 6 Tal Nisan 2017-02-05 16:22:33 UTC
*** Bug 1410320 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.