Bug 1219098 - VMs ordered from a service are not being enumerated
Summary: VMs ordered from a service are not being enumerated
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
high
urgent
Target Milestone: GA
: 5.4.0
Assignee: Greg McCullough
QA Contact: Shveta
URL:
Whiteboard:
Depends On:
Blocks: 1220505
TreeView+ depends on / blocked
 
Reported: 2015-05-06 14:58 UTC by Josh Carter
Modified: 2019-07-11 09:06 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, when ordering from a service, the VMs provisioned by that service were not being enumerated. If a second user provisioned, that user's provision failed with a duplicate VM name conflict. This was due to create_request_task did not yield task before saving. With this update, create_request_task was changes to yield task before saving. This has resolved the issue and VMs are now enumerated for each service request.
Clone Of:
: 1220505 (view as bug list)
Environment:
Last Closed: 2015-06-16 13:01:48 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1442553 0 None None None Never
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

Description Josh Carter 2015-05-06 14:58:23 UTC
Description of problem:

When ordering from a service the vm's provisioned by that services are not being enumerated. If a second user provisions that users provision will fail with a duplicate vm name conflict. 

[----] I, [2015-05-06T14:47:34.719374 #15171:12bc888]  INFO -- : Q-task_id([service_template_provision_task_12000000000013]) <AutomationEngine> In State=[checkprovisioned], invoking [
on_error] method=[update_serviceprovision_status(status => '[MiqException::MiqProvisionError]: A VM with name: [ose-system] already exists')]
[----] I, [2015-05-06T14:47:34.743095 #13337:88b080]  INFO -- : Q-task_id([service_template_provision_task_12000000000016]) <AutomationEngine> <AEMethod [ManageIQ/Service/Provisioning
/StateMachines/ServiceProvision_Template/update_serviceprovision_status]> Ending
[----] I, [2015-05-06T14:47:34.743252 #13337:88b080]  INFO -- : Q-task_id([service_template_provision_task_12000000000016]) <AutomationEngine> Method exited with rc=MIQ_OK
[----] E, [2015-05-06T14:47:34.744078 #13337:88b080] ERROR -- : Q-task_id([service_template_provision_task_12000000000016]) MIQ(MiqAeEngine.deliver) Error delivering {"request"=>"clon
e_to_service"} for object [ServiceTemplateProvisionTask.12000000000016] with state [checkprovisioned] to Automate:

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


How reproducible:
very

Steps to Reproduce:
1. provision from a service (ex. ose deployment)
2. 
3.

Actual results:
vm is provisioned with the same name defined in the catalog item (ose-broker)

Expected results:
vm should be enumerated for each service request (ose-broker001, ose-broker002 etc)

Additional info:

Comment 2 Greg McCullough 2015-05-07 19:41:21 UTC
Work-around for this issue:
When creating the catalog item goto the "Request Info" tab and include the name sequence marker ($n{#}) as part of the specified VM/Instance Name.  For example: test_vm_$n{4}

This will cause enumeration to be used when generating a new instance for this catalog item.

Comment 3 Oleg Barenboim 2015-05-08 20:20:38 UTC
https://github.com/ManageIQ/manageiq/pull/2878

Comment 8 CFME Bot 2015-05-12 14:42:23 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/61a5e7950a276d48c3ae5131e94aa055667f1852

commit 61a5e7950a276d48c3ae5131e94aa055667f1852
Author:     Greg McCullough <gmccullo>
AuthorDate: Thu May 7 09:29:42 2015 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Tue May 12 10:14:53 2015 -0400

    Change create_request_task to yield task before saving
    
    Added spec tests
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1219098

 vmdb/app/models/miq_provision_request_template.rb  | 34 +++++----
 vmdb/app/models/miq_request.rb                     |  3 +
 .../models/miq_provision_request_template_spec.rb  | 89 ++++++++++++++++++++++
 3 files changed, 110 insertions(+), 16 deletions(-)
 create mode 100644 vmdb/spec/models/miq_provision_request_template_spec.rb

Comment 9 CFME Bot 2015-05-12 14:42:27 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/1b8a09373b87f768cfbbab6f2ace08e22be56fe9

commit 1b8a09373b87f768cfbbab6f2ace08e22be56fe9
Author:     Greg McCullough <gmccullo>
AuthorDate: Thu May 7 09:22:49 2015 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Tue May 12 10:14:35 2015 -0400

    Refactor miq_provision_request_template.rb
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1219098

 vmdb/app/models/miq_provision_request_template.rb | 52 +++++++++++++----------
 1 file changed, 29 insertions(+), 23 deletions(-)

Comment 11 Shveta 2015-05-13 03:17:44 UTC
Not fixed in 5.4.0.0.26.20150511144816_f924bd4 .
Will check in next build

Comment 12 Shveta 2015-05-27 18:47:33 UTC
Service Vm's are enumerated.
fixed in 5.4.0.2.20150519003830_673f996

Comment 13 CFME Bot 2015-06-04 18:51:16 UTC
New commit detected on cfme/5.3.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=6a875c38b4823e3d6e2f9acbb77163e4043a5c4e

commit 6a875c38b4823e3d6e2f9acbb77163e4043a5c4e
Author:     Greg McCullough <gmccullo>
AuthorDate: Thu May 7 09:22:49 2015 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Tue May 12 11:08:27 2015 -0400

    Refactor miq_provision_request_template.rb
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1219098

 vmdb/app/models/miq_provision_request_template.rb | 52 +++++++++++++----------
 1 file changed, 29 insertions(+), 23 deletions(-)

Comment 14 CFME Bot 2015-06-04 18:51:21 UTC
New commit detected on cfme/5.3.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=65a6728b69aad96ac6e220818412ac8f86006253

commit 65a6728b69aad96ac6e220818412ac8f86006253
Author:     Greg McCullough <gmccullo>
AuthorDate: Thu May 7 09:29:42 2015 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Tue May 12 11:08:45 2015 -0400

    Change create_request_task to yield task before saving
    
    Added spec tests
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1219098

 vmdb/app/models/miq_provision_request_template.rb  | 34 +++++----
 vmdb/app/models/miq_request.rb                     |  3 +
 .../models/miq_provision_request_template_spec.rb  | 89 ++++++++++++++++++++++
 3 files changed, 110 insertions(+), 16 deletions(-)
 create mode 100644 vmdb/spec/models/miq_provision_request_template_spec.rb

Comment 15 CFME Bot 2015-06-04 18:51:25 UTC
New commit detected on cfme/5.3.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=44b20d4c22c5429aa58987640ce6e73348be1b4b

commit 44b20d4c22c5429aa58987640ce6e73348be1b4b
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed May 20 20:39:16 2015 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Thu May 21 11:24:33 2015 -0400

    Update user factory with email user and stub request approver
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1219098

 vmdb/spec/factories/user.rb                             | 5 +++++
 vmdb/spec/models/miq_provision_request_template_spec.rb | 1 +
 2 files changed, 6 insertions(+)

Comment 17 errata-xmlrpc 2015-06-16 13:01:48 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.