Bug 1249631

Summary: [Pools] - Failing to create New VM's Pools via UI based on vm template
Product: [Retired] oVirt Reporter: Michael Burman <mburman>
Component: ovirt-engine-webadminAssignee: Roy Golan <rgolan>
Status: CLOSED CURRENTRELEASE QA Contact: Artyom <alukiano>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.6CC: alukiano, bugs, cmestreg, ecohen, gklein, istein, lsurette, mburman, mgoldboi, michal.skrivanek, ratamir, rbalakri, rgolan, sbonazzo, yeylon
Target Milestone: ---Keywords: Regression, Triaged
Target Release: 3.6.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: sla
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-04 11:38:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1167284    
Attachments:
Description Flags
logs none

Description Michael Burman 2015-08-03 12:57:28 UTC
Created attachment 1058767 [details]
logs

Description of problem:
[Pools] - Failing to create New VM's Pools via UI based on vm template.

When trying to create new VM Pool via [Pools] main tab based on existing vm template(template's status is OK) i'm failing with error in the event log:
'Failed to create VM Pool new (User: admin@internal).'
'Failed to create VM new-2 (User: admin@internal).'
'Failed to create VM new-1 (User: admin@internal).'

Version-Release number of selected component (if applicable):
3.6.0-0.0.master.20150730085151.git25ae1b5.el6

How reproducible:
100

Steps to Reproduce:
1. Create template from VM
2. Try to create new Pool via [Pools] main tab in UI based on template from step 1 ^^. no matter the number of VMs, can be 1. 

Actual results:
Failed to create VM Pool

Expected results:
Should succeed 

Additional info:
I noticed this issue when was trying to verify BZ 1167284 and got blocked by this issue.

Comment 1 Michal Skrivanek 2015-08-04 07:35:29 UTC
seems related to VM pinning to multiple hosts feature


2015-08-03 15:37:00,074 ERROR [org.ovirt.engine.core.bll.AddVmCommand] (org.ovirt.thread.pool-8-thread-32) [] Command 'org.ovirt.engine.core.bll.AddVmCommand' failed: Callabl
eStatementCallback; SQL [{call insertvmstatic(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
 ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}]; ERROR: duplicate key value violates unique constraint "vm_host_pinning_map_vm_id_key"
  Where: SQL statement "INSERT INTO vm_host_pinning_map(vm_id, vds_id) SELECT  $1 , vds_id FROM fnSplitterUuid( $2 ) as vds_id"
PL/pgSQL function "insertdedicatedhoststovm" line 2 at SQL statement
SQL statement "SELECT  InsertDedicatedHostsToVm( $1 ,  $2 )"
PL/pgSQL function "insertvmstatic" line 149 at PERFORM; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "vm_host_
pinning_map_vm_id_key"

Comment 2 Omer Frenkel 2015-08-04 08:03:11 UTC
it might also be a db upgrade issue, is this a new setup or upgraded?
i could not reproduce this on master

Comment 3 Michael Burman 2015-08-04 08:20:37 UTC
Hi Omer,

It's upgraded setup.
May be the template that i'm trying to create pool from is locked in db? although the status of this template is OK.

Omer, if you want you can enter my setup and see it, it's still there. feel free to contact me, thanks.

Comment 4 Roy Golan 2015-08-04 14:06:55 UTC
that's a bug in the stored procedure.

Comment 5 Roy Golan 2015-08-10 04:47:59 UTC
*** Bug 1251148 has been marked as a duplicate of this bug. ***

Comment 6 Roy Golan 2015-08-11 12:16:20 UTC
*** Bug 1252396 has been marked as a duplicate of this bug. ***

Comment 7 Roy Golan 2015-08-19 13:01:54 UTC
*** Bug 1254582 has been marked as a duplicate of this bug. ***

Comment 8 Artyom 2015-09-01 11:43:28 UTC
Verified on rhevm-3.6.0-0.12.master.el6.noarch

Comment 9 Sandro Bonazzola 2015-11-04 11:38:16 UTC
oVirt 3.6.0 has been released on November 4th, 2015 and should fix this issue.
If problems still persist, please open a new BZ and reference this one.