Bug 1324799

Summary: Export template without choosing 'force override' fails
Product: [oVirt] ovirt-engine Reporter: sefi litmanovich <slitmano>
Component: BLL.VirtAssignee: Tomas Jelinek <tjelinek>
Status: CLOSED WORKSFORME QA Contact: meital avital <mavital>
Severity: high Docs Contact:
Priority: medium    
Version: 4.0.0CC: bugs, slitmano
Target Milestone: ovirt-4.0.0-betaFlags: michal.skrivanek: ovirt-4.0.0?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-17 07:09:34 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 sefi litmanovich 2016-04-07 10:42:44 UTC
Description of problem:

Export template (with or without disk) fails. Export domain is empty and has no templates at all, but the error in webadmin is:
"Cannot export Template. The Template name is already in use, please choose a unique name and try again."
The template is not in use at all at the time of attempt.
from engine.log:


2016-04-07 13:37:41,908 INFO  [org.ovirt.engine.core.bll.exportimport.ExportVmTemplateCommand] (default task-6) [c1f01f] Lock Acquired to object 'EngineLock:{exclusiveLocks='[0cb9d169-ea04-4203-bafa-3ecfeffb71b4=<REMOTE_TEMPLATE, ACTION_TYPE_FAILED_TEMPLATE_IS_BEING_EXPORTED$TemplateName bbbb>]', sharedLocks='[0cb9d169-ea04-4203-bafa-3ecfeffb71b4=<TEMPLATE, ACTION_TYPE_FAILED_TEMPLATE_IS_BEING_EXPORTED$TemplateName bbbb>]'}'
2016-04-07 13:37:41,939 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand] (default task-6) [c1f01f] START, GetImageInfoVDSCommand( GetImageInfoVDSCommandParameters:{runAsync='true', storagePoolId='134f44d1-42c0-4268-9751-375b9246d07b', ignoreFailoverLimit='false', storageDomainId='4ebc1a3a-0973-4316-8be0-f907e8036f6b', imageGroupId='6e76f972-4e15-4b57-a09a-57bdc8ebe4d4', imageId='13714d1e-86ed-46f2-932e-431ceb61768a'}), log id: 763de679
2016-04-07 13:37:42,955 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand] (default task-6) [c1f01f] FINISH, GetImageInfoVDSCommand, return: org.ovirt.engine.core.common.businessentities.storage.DiskImage@9f1ce592, log id: 763de679
2016-04-07 13:37:42,956 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImagesListVDSCommand] (default task-6) [c1f01f] START, GetImagesListVDSCommand( GetImagesListVDSCommandParameters:{runAsync='true', storagePoolId='134f44d1-42c0-4268-9751-375b9246d07b', ignoreFailoverLimit='false', sdUUID='079c739f-b550-45c1-aa99-40845ee9a8e5'}), log id: 7f3d5478
2016-04-07 13:37:43,965 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImagesListVDSCommand] (default task-6) [c1f01f] FINISH, GetImagesListVDSCommand, return: [9cb0047c-2536-49cb-990c-f7030989e98c], log id: 7f3d5478
2016-04-07 13:37:43,971 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetVmsInfoVDSCommand] (default task-6) [c1f01f] START, GetVmsInfoVDSCommand( GetVmsInfoVDSCommandParameters:{runAsync='true', storagePoolId='134f44d1-42c0-4268-9751-375b9246d07b', ignoreFailoverLimit='false', storageDomainId='079c739f-b550-45c1-aa99-40845ee9a8e5', vmIdList='null'}), log id: a8b86da
2016-04-07 13:37:44,981 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetVmsInfoVDSCommand] (default task-6) [c1f01f] FINISH, GetVmsInfoVDSCommand, log id: a8b86da
2016-04-07 13:37:44,985 WARN  [org.ovirt.engine.core.bll.exportimport.ExportVmTemplateCommand] (default task-6) [c1f01f] Validation of action 'ExportVmTemplate' failed for user admin@internal. Reasons: VAR__ACTION__EXPORT,VAR__TYPE__VM_TEMPLATE,ACTION_TYPE_FAILED_NAME_ALREADY_USED
2016-04-07 13:37:44,985 INFO  [org.ovirt.engine.core.bll.exportimport.ExportVmTemplateCommand] (default task-6) [c1f01f] Lock freed to object 'EngineLock:{exclusiveLocks='[0cb9d169-ea04-4203-bafa-3ecfeffb71b4=<REMOTE_TEMPLATE, ACTION_TYPE_FAILED_TEMPLATE_IS_BEING_EXPORTED$TemplateName bbbb>]', sharedLocks='[0cb9d169-ea04-4203-bafa-3ecfeffb71b4=<TEMPLATE, ACTION_TYPE_FAILED_TEMPLATE_IS_BEING_EXPORTED$TemplateName bbbb>]'}'


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

ovirt-engine-4.0.0-0.0.master.20160405102116.git3819ab7.el7.centos.noarch

How reproducible:


Steps to Reproduce:
1.Create vm (can do without disk as well).
2.Create a template from this VM.
3. Try to export template - do not choose 'force override' option.

Actual results:
Action fails with: "Cannot export Template. The Template name is already in use, please choose a unique name and try again."

Expected results:
Template is imported successfully to export domain.

Additional info:
1. Works when choosing 'force override'.
2. Export VM did work fine.

Comment 1 Michal Skrivanek 2016-04-08 08:52:12 UTC
could it be query permissions again?

Comment 2 sefi litmanovich 2016-04-10 07:46:40 UTC
The action was invoked as admin which is a superuser just to be clear.

Comment 3 Sandro Bonazzola 2016-05-02 09:59:19 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 4 Tomas Jelinek 2016-05-13 08:58:00 UTC
I can not simulate this, I need some more info:

When you press the "export" and the template is already on export domain, it should show you a warning that:

"Template(s): t1 already exist on the target Export Domain. If you want to override them, please check the 'Force Override' check-box."

Do you see this warning? Or the warning is not there and it just fails to export?

Have you ever exported this template before it started to complain that it is already on export domain? (e.g. export, delete from export domain, export again)?

Did you have some other templates on export domain?

Comment 5 sefi litmanovich 2016-05-15 08:00:14 UTC
What I described in description was exactly what happened. It is not the suggested warning that appeared but export just failed and as I mentioned, the error message was: "Cannot export Template. The Template name is already in use, please choose a unique name and try again"

I also don't know what caused the original problem, but is seems now I cannot re produce it anymore (system was updated since opening this bug). Other than the snippet of engine.log I copied to description I did not get any useful information. Should we close the bug?

Comment 6 Tomas Jelinek 2016-05-17 07:09:34 UTC
since the log snippet does not give any clue why this issue happened, I'm closing this as works for me. Please feel free to reopen if it happens again.