Bug 1523072 - Cannot export a VM to an export domain when specifying the storage domain by its name (Incomplete lookup for method signature)
Summary: Cannot export a VM to an export domain when specifying the storage domain by ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ovirt-4.2.0
: 4.2.0
Assignee: Juan Hernández
QA Contact: Lucie Leistnerova
URL:
Whiteboard:
: 1524302 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-07 07:40 UTC by Arik
Modified: 2019-04-28 11:12 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-12-20 11:10:48 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.2+
rule-engine: blocker+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 85182 0 master MERGED Fix signature combining `or` and `mandatory` 2017-12-07 14:23:39 UTC
oVirt gerrit 85194 0 master MERGED restapi: Update to version 1.2.16 of the metamodel 2017-12-07 15:35:38 UTC
oVirt gerrit 85254 0 ovirt-engine-4.2.0.z ABANDONED restapi: Update to version 1.2.16 of the metamodel 2017-12-11 09:38:22 UTC

Description Arik 2017-12-07 07:40:28 UTC
Description of problem:
"No method signature found" is returned when trying to export a VM to an export domain when specifying the storage domain by its name.

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

How reproducible:
100%

Steps to Reproduce:
1. Invoke export VM via REST-API when the storage domain is specified by its name:
vm_service.export(
    exclusive=True,
    discard_snapshots=True,
    storage_domain=types.StorageDomain(
        name='export'
    )
)
2.
3.

Actual results:
The operation fails because the signature of export-to-export-domain's signature is not matched.

Expected results:
The export-to-export-domain method should be invoked.

Additional info:
The generated code seems to ignore the possibility of specifying a storage domain by its name [1] but relying on getting the ID of the storage domain in the signature lookup:

/**
 * to_export_domain
 */
if (action!=null
 && action.getStorageDomain()!=null && action.getStorageDomain().getId()!=null
) {
    return VmResource.class.getMethod("exportToExportDomain", Action.class);
}

[1] https://github.com/oVirt/ovirt-engine-api-model/blob/master/src/main/java/services/VmService.java#L249

Comment 1 Oved Ourfali 2017-12-07 08:08:53 UTC
Does it happen when using the API? Or only thorough the SDK?

Comment 2 Arik 2017-12-07 08:23:12 UTC
(In reply to Oved Ourfali from comment #1)
> Does it happen when using the API? Or only thorough the SDK?

I reproduced it with the SDK but the code I quoted in comment 1 resides in the engine so I expect it to fail also when using the API.

Comment 3 Arik 2017-12-07 08:24:47 UTC
A possible workaround is to specify the storage domain using its ID:

vm_service.export(
    exclusive=True,
    discard_snapshots=True,
    storage_domain=types.StorageDomain(
        id='413b6ece-3c2a-4c17-855f-a1d2c66c67b3'
    )
)

Comment 4 Oved Ourfali 2017-12-07 11:46:03 UTC
We are working on a fix, however it is not that simple.
Do we want it to block 4.2.0 GA?
There is a workaround, working by ID.

Comment 5 Yaniv Kaul 2017-12-07 11:51:44 UTC
(In reply to Oved Ourfali from comment #4)
> We are working on a fix, however it is not that simple.
> Do we want it to block 4.2.0 GA?
> There is a workaround, working by ID.

Indeed, it's not a blocker. I'm more concerned that it's a regression, btw.

Comment 6 Oved Ourfali 2017-12-07 11:57:29 UTC
(In reply to Yaniv Kaul from comment #5)
> (In reply to Oved Ourfali from comment #4)
> > We are working on a fix, however it is not that simple.
> > Do we want it to block 4.2.0 GA?
> > There is a workaround, working by ID.
> 
> Indeed, it's not a blocker. I'm more concerned that it's a regression, btw.

We know where it comes from. We're just trying to find a good solution, which might not be immediate.

Comment 7 Juan Hernández 2017-12-07 14:52:50 UTC
This problem is fixed in version 1.2.16 of the API metamodel. That version has been already released. The problem will be completely fixed when the engine is updated to use the new version of the model.

I think we can re-target for 4.2.0, if there will be another build of 4.2.0.

Comment 8 Michal Skrivanek 2017-12-11 10:11:20 UTC
*** Bug 1524302 has been marked as a duplicate of this bug. ***

Comment 9 Lucie Leistnerova 2017-12-14 12:45:06 UTC
export with storage name in RESTAPI worked fine (also tested in sdk-java 3.6.10 and sdk-python 4.2.2 with success)

verified in ovirt-engine-restapi-4.2.0.2-0.1.el7.noarch

Comment 10 Sandro Bonazzola 2017-12-20 11:10:48 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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