Bug 1194319

Summary: Same VM name is Assigned on Two Separate Provisions
Product: Red Hat CloudForms Management Engine Reporter: Josh Carter <jocarter>
Component: AutomateAssignee: Bill Wei <bilwei>
Status: CLOSED ERRATA QA Contact: Milan Falešník <mfalesni>
Severity: urgent Docs Contact:
Priority: high    
Version: 5.3.0CC: jhardy, jocarter, mfalesni, mfeifer, obarenbo, xlecauch
Target Milestone: GA   
Target Release: 5.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.4.0.0.11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1195825 (view as bug list) Environment:
Last Closed: 2015-06-16 12:51:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1195825    
Attachments:
Description Flags
Provision naming hotfix
none
Provision name seeding script none

Description Josh Carter 2015-02-19 14:43:58 UTC
Created attachment 993647 [details]
log-1

Description of problem:

There appears to be a condition in which two provisions happen within close enough proximity of each other to cause the same name to be assigned to both.

This appears to be related to the following bit of code in our CloudForms method:  derived_vm_name << "$n{4}"
This should be appending a different number for both provisions, but instead assigned the same number in this particular instance.

I've included some logs relating to this occurrence.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 CFME Bot 2015-02-23 15:31:08 UTC
New commit detected on cfme/5.3.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=5442dc86ed9692c16b8719bbeefdb3fbd4900902

commit 5442dc86ed9692c16b8719bbeefdb3fbd4900902
Author:     Bill Wei <bilwei>
AuthorDate: Thu Jan 15 11:59:49 2015 -0500
Commit:     Bill Wei <bilwei>
CommitDate: Mon Feb 23 10:23:29 2015 -0500

    Store next naming sequence in custom_attributes
    
    With this implemenation naming sequences are global through current region.
    The binding can be changed to other models through NamingSequenceMixin.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1173336
    https://bugzilla.redhat.com/show_bug.cgi?id=1194319
    
    Conflicts:
    	vmdb/app/models/miq_provision/naming.rb

 vmdb/app/models/miq_provision/naming.rb         | 28 ++++++++-----------------
 vmdb/app/models/miq_region.rb                   |  2 +-
 vmdb/app/models/mixins/naming_sequence_mixin.rb | 17 +++++++++++++++
 vmdb/spec/models/miq_provision_spec.rb          | 18 ++++++++++++++++
 vmdb/spec/models/miq_region_spec.rb             |  7 +++++++
 5 files changed, 52 insertions(+), 20 deletions(-)
 create mode 100644 vmdb/app/models/mixins/naming_sequence_mixin.rb

Comment 4 Greg McCullough 2015-02-23 17:00:04 UTC
Created attachment 994452 [details]
Provision naming hotfix

Comment 5 Greg McCullough 2015-02-23 17:00:39 UTC
Created attachment 994453 [details]
Provision name seeding script

Comment 8 Milan Falešník 2015-04-17 13:36:10 UTC
Hi Josh,

could you be more specific with the details how to reproduce this issue?

Thanks.

Comment 14 Milan Falešník 2015-05-19 15:06:36 UTC
The VMs are enumerated automatically on 5.4.0.1

Comment 15 Marianne Feifer 2015-05-28 14:32:40 UTC
Fixed in previous errata.  Setting to requires_doc_text-

Comment 17 errata-xmlrpc 2015-06-16 12:51:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

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

https://rhn.redhat.com/errata/RHBA-2015-1100.html