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

Bug 1344048

Summary: When importing an image as a template from Glance via the REST API, the template's name is ignored and a default one is generated
Product: [oVirt] ovirt-engine Reporter: Idan Shaby <ishaby>
Component: RestAPIAssignee: Idan Shaby <ishaby>
Status: CLOSED CURRENTRELEASE QA Contact: Carlos Mestre González <cmestreg>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.6.2CC: amureini, bugs, gklein, mperina
Target Milestone: ovirt-4.0.0-rcFlags: rule-engine: ovirt-4.0.0+
rule-engine: planning_ack+
amureini: devel_ack+
acanan: testing_ack+
Target Release: 4.0.0   
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: 2016-08-01 12:24:42 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:

Description Idan Shaby 2016-06-08 15:20:14 UTC
Description of problem:
When importing an image as a template from Glance via the REST API, the template's name is ignored and a default one is generated.

There are two URLs that can be used to import the image via the REST API:
1. .../api/storagedomains/<domain_id>/images/<image_id>/import
2. .../api/openstackimageproviders/<provider_id>/images/<image_id>/import

The first option works, the second doesn't.

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

How reproducible:
100%

Steps to Reproduce:
Using a URL of the form:
".../api/openstackimageproviders/<provider_id>/images/<image_id>/import"
Send a post request:
<action>
  <storage_domain id="<domain_id>"/>
  <cluster id="<cluster_id>"/>
  <import_as_template>true</import_as_template>
  <template><name>template_name</name></template>
  <disk><alias>alias</alias></disk>
</action>

Actual results:
A new default template's name is generated, something that looks like "GlanceTemplate-<7_GUID_chars>".

Expected results:
The template's name should be "template_name".

Comment 1 Red Hat Bugzilla Rules Engine 2016-06-08 15:21:45 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 2 Martin Perina 2016-06-10 15:06:17 UTC
Setting target release to 4.0.0 as it's included in today's 4.0.0.4 build

Comment 4 Carlos Mestre González 2016-07-07 16:03:15 UTC
verified: rhevm-4.0.2-0.2.rc1.el7ev.noarch