Bug 1416306

Summary: Trying to import a Glance template with >40 chars long name should fail as an ERROR, not a WARNING
Product: [oVirt] ovirt-engine Reporter: Yaniv Kaul <ykaul>
Component: Backend.CoreAssignee: Shahar Havivi <shavivi>
Status: CLOSED CURRENTRELEASE QA Contact: Raz Tamir <ratamir>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.1.0CC: bugs, mavital, tjelinek
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
rule-engine: planning_ack+
rule-engine: devel_ack+
mavital: testing_ack+
Target Release: 4.2.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 11:25:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yaniv Kaul 2017-01-25 08:45:39 UTC
Description of problem:
Currently, when trying via the SDK to import a Glance image with a name > 40 chars fails - with a warning. This does not return to the API/client.

2017-01-25 03:20:43,921-05 WARN  [org.ovirt.engine.core.bll.AddVmTemplateCommand] (DefaultQuartzScheduler4) [25199929] Validation of action 'AddVmTemplate' failed for user admin@internal-authz. Reasons: VAR__ACT
ION__ADD,VAR__TYPE__VM_TEMPLATE,VALIDATION_VM_TEMPLATE_NAME_MAX,$groups [Ljava.lang.Class;@2c7e982d,$min 1,$message VALIDATION_VM_TEMPLATE_NAME_MAX,$payload [Ljava.lang.Class;@199b587e,$max 40,ACTION_TYPE_FAILED
_ATTRIBUTE_PATH,$path _name


Version-Release number of selected component (if applicable):
Master.

How reproducible:

100% 

Steps to Reproduce:
1. Import a Glance disk with a long name. via the API.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Shahar Havivi 2017-03-23 09:05:13 UTC
Currently we are limiting the Template name to 40 characters which is wrong, the VM and the DB have 255 limitation.

Note for QE, can be tested with this script:
https://gerrit.ovirt.org/#/c/74496/

Comment 2 Raz Tamir 2017-09-26 14:04:47 UTC
Verified on ovirt-engine-4.2.0-0.0.master.20170924221426.git196b802.el7.centos

POST to api/storagedomains/6e86706b-a08e-4301-8148-bcb4f4c05ba2/images/903ba233-dc33-4cdf-9275-02fc21ce6b46/import

<action>
  <import_as_template>True</import_as_template>
  <template>
    <name>111111111111111111111111111111111111111111111111111111111111</name>
  </template>
  <storage_domain id="2004622b-d3de-46a8-a99d-86efea58b91f"/>
  <cluster id="8f16ac6a-e68b-4619-9ae8-4636d3326c60"/>
</action>

Template name length is 60 chars

Template created successfully

Comment 3 Sandro Bonazzola 2017-12-20 11:25:15 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.