Bug 1173336 - Duplicate vm names when multiple soap requests are issued
Summary: Duplicate vm names when multiple soap requests are issued
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.3.0
Hardware: All
OS: All
medium
medium
Target Milestone: GA
: 5.4.0
Assignee: Bill Wei
QA Contact: Milan Falešník
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-11 21:29 UTC by Josh Carter
Modified: 2019-07-11 08:27 UTC (History)
3 users (show)

Fixed In Version: 5.4.0.0.11
Doc Type: Bug Fix
Doc Text:
In the previous version of CloudForms Management Engine, during VM provisioning, if the VM name was defined to use enumeration as part of the naming, the get_vm_full_name method was called in /app/models/miq_provision/naming.rb. This method can be called from multiple processes (across multiple appliance) at the same time and in a race condition resulted in the same enumeration value being returned. As a result, duplicate VM names were issued with multiple soap requests during provisioning. This bug has been fixed by implementing store next naming sequence in custom_attributes. Thus, naming sequences are global through current region.
Clone Of:
Environment:
Last Closed: 2015-06-16 12:46:22 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1100 0 normal SHIPPED_LIVE CFME 5.4.0 bug fixes, and enhancement update 2015-06-16 16:28:42 UTC

Comment 2 Greg McCullough 2015-01-13 14:52:03 UTC
During VM provisioning if the VM name is defined to use enumeration as part of the naming the get_vm_full_name method is called in /app/models/miq_provision/naming.rb.  This method can be called from multiple processes (across multiple appliance) at the same time and in a race condition would result in the same enumeration value being returned.

I have some thoughts around an enhancement to this feature to push more of the logic into automate and the automate model, but we still need to protect against this race condition with the existing logic.

Comment 3 CFME Bot 2015-02-09 20:05:43 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/d2689d3c182475861973885bfaf5f74b7d484205

commit d2689d3c182475861973885bfaf5f74b7d484205
Author:     Bill Wei <bilwei>
AuthorDate: Thu Jan 15 11:59:49 2015 -0500
Commit:     Bill Wei <bilwei>
CommitDate: Thu Jan 29 10:29:15 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

 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 CFME Bot 2015-02-23 15:31:05 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 8 Milan Falešník 2015-05-19 15:06:10 UTC
Ok, verified then on 5.4.0.1, it appears to be working.

Comment 10 errata-xmlrpc 2015-06-16 12:46:22 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


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