Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1411123 - [REST-API] Glance image import: Imported image ID is missing from response body
Summary: [REST-API] Glance image import: Imported image ID is missing from response body
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.1.0
Hardware: x86_64
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.1.0-beta
: 4.1.0.2
Assignee: Maor
QA Contact: Elad
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-08 14:56 UTC by Elad
Modified: 2017-02-01 14:52 UTC (History)
3 users (show)

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


Attachments (Terms of Use)
engine.log, server.log (521.66 KB, application/x-gzip)
2017-01-08 14:56 UTC, Elad
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 70627 0 master MERGED restAPI: Set the disk id on return value when import from glance. 2020-01-31 13:31:08 UTC
oVirt gerrit 70680 0 ovirt-engine-4.1 MERGED restAPI: Set the disk id on return value when import from glance. 2020-01-31 13:31:08 UTC

Description Elad 2017-01-08 14:56:23 UTC
Created attachment 1238399 [details]
engine.log, server.log

Description of problem:
No image ID in response body when importing a Glance image via REST API.
We use the image ID in RHV automation jobs for Glance import operation verification. Hence, the test cases that rely on this don't pass.

Version-Release number of selected component (if applicable):
ovirt-engine-4.1.0-0.4.master.20170104181027.gitab0e3f4.el7.centos.noarch

How reproducible:
Always

Steps to Reproduce:
URL:
url:/<engine_addr>/api/storagedomains/%Glance_repository_ID%/images/%image_ID/import


Request body:

<action>
    <async>false</async>
    <cluster>
        <name>CL_NAME</name>
    </cluster>
    <disk>
        <name>DISK_NAME</name>
    </disk>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
    <import_as_template>false</import_as_template>
    <storage_domain>
        <name>SD_NAME</name>
    </storage_domain>
</action>


Actual results:
Response body:

<action>
    <async>false</async>
    <cluster>
        <name>golden_env_mixed_1</name>
    </cluster>
    <disk>
        <name>glance_image_10697</name>
    </disk>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
    <import_as_template>false</import_as_template>
    <status>complete</status>
    <storage_domain>
        <name>nfs_1</name>
    </storage_domain>
</action>


Expected results:
Image ID should be part of the response. 

Additional info:
engine.log, server.log

2017-01-08 14:44:30,408+02 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (DefaultQuartzScheduler6) [] Correlation ID: 9f5b76d, Job ID: 13a10610-d517-4428-92c3-626f2ef276ab, Call Stack: null, Custom Event ID: -1, Message: The disk 'glance_image_10697' was successfully added

Comment 1 Yaniv Kaul 2017-01-09 07:13:52 UTC
Still this does not sound like a high severity bug. Is this a regression?

Comment 2 Elad 2017-01-09 15:37:09 UTC
Yes, it's a regression. 
This is the response body I get for the same action in 4.0:

<action>
<async>false</async>
<cluster>
<name>CL_NAME</name>
</cluster>
<disk href= "/ovirt-engine/api/disks/9012eeed-50e7-4dbf-b496-3653d335e81c" id="9012eeed-50e7-4dbf-b496-3653d335e81c">
<actions>
<link href= "/ovirt-engine/api/disks/9012eeed-50e7-4dbf-b496-3653d335e81c/export" rel="export"/>
<link href= "/ovirt-engine/api/disks/9012eeed-50e7-4dbf-b496-3653d335e81c/move" rel="move"/>
<link href= "/ovirt-engine/api/disks/9012eeed-50e7-4dbf-b496-3653d335e81c/copy" rel="copy"/>
</actions>
</disk>
<grace_period>
<expiry>10</expiry>
</grace_period>
<import_as_template>false</import_as_template>
<status>complete</status>
<storage_domain>
<name>nfs_0</name>
</storage_domain>
</action>

Comment 3 Maor 2017-01-17 10:52:30 UTC
Elad,
Was those requests being done using version 3 of the API or version 4 of the API?

Comment 4 Elad 2017-01-17 11:08:35 UTC
v4

Comment 5 Elad 2017-01-26 14:20:02 UTC
Image ID is in the response body of import image from Glance:

<action>
<async>false</async>
<cluster>
<name>golden_env_mixed_1</name>
</cluster>
<disk href= "/ovirt-engine/api/disks/88fac556-b533-4ef3-bfa1-aa0fd9a2e309" id="88fac556-b533-4ef3-bfa1-aa0fd9a2e309">
<actions>
<link href= "/ovirt-engine/api/disks/88fac556-b533-4ef3-bfa1-aa0fd9a2e309/sparsify" rel="sparsify"/>
<link href= "/ovirt-engine/api/disks/88fac556-b533-4ef3-bfa1-aa0fd9a2e309/export" rel="export"/>
<link href= "/ovirt-engine/api/disks/88fac556-b533-4ef3-bfa1-aa0fd9a2e309/move" rel="move"/>
<link href= "/ovirt-engine/api/disks/88fac556-b533-4ef3-bfa1-aa0fd9a2e309/copy" rel="copy"/>
</actions>
</disk>
<grace_period>
<expiry>10</expiry>
</grace_period>
<import_as_template>false</import_as_template>
<status>complete</status>
<storage_domain>
<name>nfs_0</name>
</storage_domain>
</action>

====================
Tested using:
rhevm-4.1.0.2-0.2.el7.noarch
ovirt-engine-restapi-4.1.0.2-0.2.el7.noarch


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