Bug 1285446 - Random sub-template of given name is used to create VM Pool via REST
Summary: Random sub-template of given name is used to create VM Pool via REST
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.0.0-alpha
: 4.0.0
Assignee: Marek Libra
QA Contact: sefi litmanovich
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-25 15:41 UTC by jniederm
Modified: 2016-07-13 03:52 UTC (History)
7 users (show)

Fixed In Version: ovirt 4.0.0 alpha1
Doc Type: Enhancement
Doc Text:
When creating a virtual machine using the template name or Blank and not specifying the template version in the REST API, the latest template version is used. Prior to this enhancement, the template version, if not specified, was randomly selected.
Clone Of:
Environment:
Last Closed: 2016-07-05 07:44:11 UTC
oVirt Team: Virt
rule-engine: ovirt-4.0.0+
gklein: testing_plan_complete-
rule-engine: planning_ack+
tjelinek: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 50464 0 master MERGED core: Templates retrieved by name are sorted 2015-12-16 08:37:59 UTC

Description jniederm 2015-11-25 15:41:50 UTC
Description of problem:
Unspecified sub-template is chosen to create VM Pool when template is specified by name.

Version-Release number of selected component (if applicable):
4.0 master, commit 5e447e0

How reproducible:
Based on order of rows returned from DB

Steps to Reproduce:
1. Create multiple sub-versions of template "t1"
2. REST request
POST /ovirt-engine/api/vmpools HTTP/1.1
Host: localhost:8080
Authorization: Basic YWRtaW5AaW50ZXJuYWw6YQ==
Content-Type: application/xml

<vm_pool>
    <name>pool1</name>
    <cluster>
        <name>Default</name>
    </cluster>
    <template>
        <name>t1</name>
    </template>
</vm_pool>

Actual results:
Pool is created. However the sub-version of template that is picked to base vm pool on depends on order of records returned by "GetVmTemplateByVmtName" stored procedure.

Expected results:
Either the base template or the latest template is always selected.

Additional info:
see: org.ovirt.engine.api.restapi.resource.BackendVmPoolsResource#getVmTemplate

Comment 1 Tomas Jelinek 2015-12-16 08:42:35 UTC
If the template is specified by ID it will work as expected, thus setting target to 4.0

Comment 2 sefi litmanovich 2016-05-24 13:40:14 UTC
Verified with ovirt-engine-4.0.0-0.7.master.el7ev.noarch, vm pool gets the highest version of the template when given only template name in creation via REST.

Comment 3 Sandro Bonazzola 2016-07-05 07:44:11 UTC
oVirt 4.0.0 has been released, closing current release.


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