Bug 1468313 - Creating a new Pool fails if 'Auto select target' check box is enabled and the created Pool is based on a Template with at least two disks from the same Data Domain
Creating a new Pool fails if 'Auto select target' check box is enabled and th...
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ovirt-4.1.5
Assigned To: Sharon Gratch
Nisim Simsolo
Depends On:
  Show dependency treegraph
Reported: 2017-07-06 12:17 EDT by Sharon Gratch
Modified: 2017-08-23 04:07 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-08-23 04:07:01 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.1+

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 79301 master MERGED core: create Pool with 'auto select target' on disks with identical DD 2017-07-12 10:33 EDT

  None (edit)
Description Sharon Gratch 2017-07-06 12:17:39 EDT
Description of problem:
Trying to create new Pool based on a Template with at least two disks from the same Data Domain (same Target) and checking the 'Auto select target' check box (in 'Resource Allocation' side tab), causes the whole pool creation to fail with the following error:
ERROR [org.ovirt.engine.core.bll.AddVmPoolCommand] (default task-61) [2cc7a883-e071-4198-98af-868344152e44] Error during ValidateFailure.: java.lang.IllegalStateException: Duplicate key StorageDomain

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

How reproducible:

Steps to Reproduce:
1.Open a new Pool dialog
2.Select a Template with at least two disks from the same Data Domain (Target).
3. Go to 'Resource Allocation' side tab and check the 'Auto select target' check box.

Actual results:
The Pool creation fails.

Expected results:
Pool creation should succeed. 

Additional info:
This bug is because of invalid using of Java Streams in ImagesHandler (done as part of a re-factoring patch in 6/6/17):
stream().collect(Collectors.toMap(<non unique/distinct keys list>, values)) - it was assumed it will take the last key in the stream, but instead it fails the whole state with "Duplicate key" error.
Comment 1 Sharon Gratch 2017-07-06 12:18:37 EDT
I have a patch ready for master branch for fixing this bug
Comment 2 Tomas Jelinek 2017-07-12 02:38:43 EDT
patch seems to be trivial - targeting 4.1.6
Comment 3 Sharon Gratch 2017-07-16 06:34:49 EDT
can we set Target Milestone to 4.1.5 (since a patch for master was merged already)?
Comment 4 Sharon Gratch 2017-07-19 08:04:20 EDT
This bug was caused due to a re-factoring patch - commit number: a6d29adf20b905.
Since this re-factoring patch was not back-ported to 4.1, the problem is not reproduced on 4.1.z and therefor this bug can me marked as MODIFIED without the need to back-port.
So changing status to MODIFIED.
Comment 5 rhev-integ 2017-07-28 08:16:10 EDT
INFO: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[No relevant external trackers attached]

For more info please contact: infra@ovirt.org
Comment 6 Nisim Simsolo 2017-08-17 09:07:43 EDT
Verification builds:

Note You need to log in before you can comment on or make changes to this bug.