Bug 1285446 - Random sub-template of given name is used to create VM Pool via REST
Random sub-template of given name is used to create VM Pool via REST
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt (Show other bugs)
Unspecified Unspecified
unspecified Severity medium (vote)
: ovirt-4.0.0-alpha
: 4.0.0
Assigned To: Marek Libra
sefi litmanovich
: Improvement
Depends On:
  Show dependency treegraph
Reported: 2015-11-25 10:41 EST by jniederm
Modified: 2016-07-12 23:52 EDT (History)
7 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Last Closed: 2016-07-05 03:44:11 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Virt
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑4.0.0+
gklein: testing_plan_complete-
rule-engine: planning_ack+
tjelinek: devel_ack+
mavital: testing_ack+

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 50464 master MERGED core: Templates retrieved by name are sorted 2015-12-16 03:37 EST

  None (edit)
Description jniederm 2015-11-25 10:41:50 EST
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


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 03:42:35 EST
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 09:40:14 EDT
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 03:44:11 EDT
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.