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

Bug 1411123

Summary: [REST-API] Glance image import: Imported image ID is missing from response body
Product: [oVirt] ovirt-engine Reporter: Elad <ebenahar>
Component: RestAPIAssignee: Maor <mlipchuk>
Status: CLOSED CURRENTRELEASE QA Contact: Elad <ebenahar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.0CC: bugs, ebenahar, tnisan
Target Milestone: ovirt-4.1.0-betaFlags: rule-engine: ovirt-4.1+
Target Release: 4.1.0.2   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-01 14:52:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine.log, server.log none

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