Bug 1351886

Summary: Unable to create VM when changing template
Product: [oVirt] ovirt-engine Reporter: Pavel Stehlik <pstehlik>
Component: Frontend.WebAdminAssignee: Tomas Jelinek <tjelinek>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Novotny <pnovotny>
Severity: high Docs Contact:
Priority: high    
Version: 4.0.0CC: bugs, cmestreg, gklein, mgoldboi, michal.skrivanek, sbonazzo
Target Milestone: ovirt-4.0.2Keywords: Regression
Target Release: 4.0.2.1Flags: rule-engine: ovirt-4.0.z+
rule-engine: blocker+
mgoldboi: planning_ack+
rule-engine: devel_ack+
pstehlik: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
New virtual machine dialog -> select a template with disks and than select the Blank template. If saved, the creation of the virtual machine failed. After this fix, you can pick the templates freely and the creation of virtual machine passes.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-12 14:24:09 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:
Attachments:
Description Flags
err-template.png none

Description Pavel Stehlik 2016-07-01 06:48:10 UTC
Created attachment 1174815 [details]
err-template.png

Description of problem:
 Try to create VM by VM tab / NewVM button, pick template & then choose Blank again. OperationCanceled dialogue will appear: Cannot add VM. One or more provided storage domains are either not in active status or of an illegal type for requested operation.

Version-Release number of selected component (if applicable):
4.0 and also 3.6

How reproducible:
100%

Steps to Reproduce:
1. create NewVM button
2. put the name of VM & choose different template than Blank
3. choose again Blank template
4. hit OK button for creating VM

Actual results:
see above & att pic

Expected results:
VM will be created

Additional info:
engine.log:
2016-07-01 08:35:15,098 INFO  [org.ovirt.engine.core.bll.AddVmCommand] (ajp-/127.0.0.1:8702-79) [79be479b] Lock Acquired to object 'EngineLock:{exclusiveLocks='[ps-err-template=<VM_NAME, ACTION_TYPE_FAILED_OBJECT_LOCKED>]', sharedLocks='[00000000-0000-0000-0000-000000000000=<TEMPLATE, ACTION_TYPE_FAILED_TEMPLATE_IS_USED_FOR_CREATE_VM$VmName ps-err-template>]'}'
2016-07-01 08:35:15,122 ERROR [org.ovirt.engine.core.bll.AddVmCommand] (ajp-/127.0.0.1:8702-79) [79be479b] Can not find any default active domain for one of the disks of template with id '00000000-0000-0000-0000-000000000000'
2016-07-01 08:35:15,122 WARN  [org.ovirt.engine.core.bll.AddVmCommand] (ajp-/127.0.0.1:8702-79) [79be479b] CanDoAction of action 'AddVm' failed for user admin@internal. Reasons: VAR__ACTION__ADD,VAR__TYPE__VM,ACTION_TYPE_FAILED_MISSED_STORAGES_FOR_SOME_DISKS
2016-07-01 08:35:15,122 INFO  [org.ovirt.engine.core.bll.AddVmCommand] (ajp-/127.0.0.1:8702-79) [79be479b] Lock freed to object 'EngineLock:{exclusiveLocks='[ps-err-template=<VM_NAME, ACTION_TYPE_FAILED_OBJECT_LOCKED>]', sharedLocks='[00000000-0000-0000-0000-000000000000=<TEMPLATE, ACTION_TYPE_FAILED_TEMPLATE_IS_USED_FOR_CREATE_VM$VmName ps-err-template>]'}'

Comment 1 Carlos Mestre González 2016-07-11 11:35:56 UTC
*** Bug 1354413 has been marked as a duplicate of this bug. ***

Comment 2 Michal Skrivanek 2016-07-25 10:15:44 UTC
note it happens only when selecting a template with disk(s) and then a template without any disk(e.g. Blank)

Comment 3 Pavel Novotny 2016-07-28 16:49:30 UTC
Verified in
ovirt-engine-webadmin-portal-4.0.2.1-0.1.el7ev.noarch
rhevm-4.0.2.1-0.1.el7ev.noarch

Verification steps:
1. Have a VM template with disk(s) called 'tmpl-disks'.
2. Click VMs -> New
3. Select Template -> tmpl-disks -> Blank and submit.

Result: VM is successfully created, no errors/warnings in engine.log.