Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1523072

Summary: Cannot export a VM to an export domain when specifying the storage domain by its name (Incomplete lookup for method signature)
Product: [oVirt] ovirt-engine Reporter: Arik <ahadas>
Component: RestAPIAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Lucie Leistnerova <lleistne>
Severity: high Docs Contact:
Priority: high    
Version: 4.2.0CC: ahadas, bugs, michal.skrivanek, mkalfon, mperina, oourfali, ykaul
Target Milestone: ovirt-4.2.0Keywords: Regression
Target Release: 4.2.0Flags: rule-engine: ovirt-4.2+
rule-engine: blocker+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 11:10:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.