Bug 1396066

Summary: Service bundle provisioning fails when quota enabled
Product: Red Hat CloudForms Management Engine Reporter: Aziza Karol <akarol>
Component: ProvisioningAssignee: Tina Fitzgerald <tfitzger>
Status: CLOSED CURRENTRELEASE QA Contact: Aziza Karol <akarol>
Severity: urgent Docs Contact:
Priority: high    
Version: 5.7.0CC: akarol, cpelland, jhardy, obarenbo, sbulage
Target Milestone: GAKeywords: TestOnly
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: quota
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1399802 (view as bug list) Environment:
Last Closed: 2017-06-12 16:14:12 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:
Bug Depends On:    
Bug Blocks: 1399802    

Description Aziza Karol 2016-11-17 11:53:24 UTC
Description of problem:


Version-Release number of selected component (if applicable):
5.7.0.11-rc1.20161115160629_46cf4f1

How reproducible:
100%

Steps to Reproduce:
1.create a catalog item of type vmware
2.create a catalog bundle by adding the above resource.
3.make sure CloudForms quotas are enabled
4.provision the bundle

Actual results:
NoMethodError: undefined method `starts_with?' for nil:NilClass  thrown in production log.

Expected results:
Automation.log:
[----] I, [2016-11-17T06:39:24.263225 #2729:3b914c]  INFO -- : Q-task_id([service_template_provision_request_3]) <AEMethod [/ManageIQ/System/CommonMethods/QuotaMethods/requested]> Starting 
[----] I, [2016-11-17T06:39:25.090650 #2729:3aa2a0]  INFO -- : Q-task_id([service_template_provision_request_3]) <AEMethod requested> Request: Provisioning Service [bundle_test] from [bundle_test] id: 3 
[----] I, [2016-11-17T06:39:25.093716 #2729:3aa2a0]  INFO -- : Q-task_id([service_template_provision_request_3]) <AEMethod requested> Adding seq_id: 0 key: :dialog_ele value: "cxv" to options_hash
[----] I, [2016-11-17T06:39:25.094690 #2729:3aa2a0]  INFO -- : Q-task_id([service_template_provision_request_3]) <AEMethod requested> Inspecting options_hash: {0=>{:dialog_ele=>"cxv"}}
[----] I, [2016-11-17T06:39:25.103252 #2729:3aa2a0]  INFO -- : Q-task_id([service_template_provision_request_3]) <AEMethod requested> service_template id: 2 service_type: composite
[----] E, [2016-11-17T06:39:25.105166 #2729:3aa2a0] ERROR -- : Q-task_id([service_template_provision_request_3]) <AEMethod requested> The following error occurred during method evaluation:
[----] E, [2016-11-17T06:39:25.110755 #2729:3aa2a0] ERROR -- : Q-task_id([service_template_provision_request_3]) <AEMethod requested>   NoMethodError: undefined method `starts_with?' for nil:NilClass
[----] E, [2016-11-17T06:39:25.112215 #2729:3aa2a0] ERROR -- : Q-task_id([service_template_provision_request_3]) <AEMethod requested>   
[----] E, [2016-11-17T06:39:25.118774 #2729:3aa2a0] ERROR -- : Q-task_id([service_template_provision_request_3]) Method STDERR: <code: if @service && @service_template.prov_type.starts_with?("generic")>:261:in `<main>': undefined method `starts_with?' for nil:NilClass (NoMethodError)
[----] I, [2016-11-17T06:39:25.147639 #2729:3b914c]  INFO -- : Q-task_id([service_template_provision_request_3]) <AEMethod [/ManageIQ/System/CommonMethods/QuotaMethods/requested]> Ending
[----] E, [2016-11-17T06:39:25.148526 #2729:3b914c] ERROR -- : Q-task_id([service_template_provision_request_3]) Aborting instantiation (unknown method return code) because [Method exited with rc=Unknown RC: [1]]
[----] E, [2016-11-17T06:39:25.149033 #2729:3b914c] ERROR -- : Q-task_id([service_template_provision_request_3]) State=<requested> running  raised exception: <Method exited with rc=Unknown RC: [1]>
[----] W, [2016-11-17T06:39:25.149296 #2729:3b914c]  WARN -- : Q-task_id([service_template_provision_request_3]) Error in State=[requested]
[----] I, [2016-11-17T06:39:25.149741 #2729:3b914c]  INFO -- : Q-task_id([service_template_provision_request_3]) Followed  Relationship [miqaedb:/System/CommonMethods/QuotaStatemachine/quota#create]
[----] I, [2016-11-17T06:39:25.150404 #2729:3b914c]  INFO -- : Q-task_id([service_template_provision_request_3]) Followed  Relationship [miqaedb:/System/Policy/ServiceTemplateProvisionRequest_starting#create]
[----] I, [2016-11-17T06:39:25.150817 #2729:3b914c]  INFO -- : Q-task_id([service_template_provision_request_3]) Followed  Relationship [miqaedb:/System/Policy/request_starting#create]
[----] I, [2016-11-17T06:39:25.151348 #2729:3b914c]  INFO -- : Q-task_id([service_template_provision_request_3]) Followed  Relationship [miqaedb:/System/Event/RequestEvent/Request/request_starting#create]



Additional info:

Comment 2 Tina Fitzgerald 2016-11-17 15:52:08 UTC
Hi Aziza,

Can I access your appliance?

Thanks,
Tina

Comment 3 Tina Fitzgerald 2016-11-17 21:20:49 UTC
Hi Aziza,

Please disregard my last message. I don't need access to your appliance.

Thanks,
Tina

Comment 5 CFME Bot 2016-11-28 22:11:26 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/218b6b22ba1a4a217a6357bd30cada49e810da60

commit 218b6b22ba1a4a217a6357bd30cada49e810da60
Author:     Tina Fitzgerald <tfitzger>
AuthorDate: Wed Nov 23 12:20:31 2016 -0500
Commit:     Tina Fitzgerald <tfitzger>
CommitDate: Mon Nov 28 15:38:06 2016 -0500

    Move build_model to service_template_helper and refactor to build model
    from VMs.(Madhu)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1396066

 .../catalog_bundle_initialization_spec.rb          | 19 +------------------
 .../catalog_item_initialization_spec.rb            | 19 +------------------
 spec/support/service_template_helper.rb            | 22 ++++++++++++++++++++++
 3 files changed, 24 insertions(+), 36 deletions(-)

Comment 6 CFME Bot 2016-11-28 22:11:31 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/6e8d4b4c5b01867f09bb9b508d7534bb6d2389b3

commit 6e8d4b4c5b01867f09bb9b508d7534bb6d2389b3
Author:     Tina Fitzgerald <tfitzger>
AuthorDate: Wed Nov 23 14:06:06 2016 -0500
Commit:     Tina Fitzgerald <tfitzger>
CommitDate: Mon Nov 28 16:35:07 2016 -0500

    Adjusted check for generic prov_type for service bundles and added test.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1396066

 .../QuotaMethods.class/__methods__/requested.rb    |  2 +-
 .../method_validation/calculate_requested_spec.rb  | 12 ++++++
 spec/support/quota_helper.rb                       | 47 ++++++++++++++++------
 spec/support/service_template_helper.rb            | 19 ++++++---
 4 files changed, 62 insertions(+), 18 deletions(-)

Comment 8 Aziza Karol 2017-03-16 05:45:23 UTC
Service bundle provisioning works when quota is enabled.

Verified:5.8.0.4.20170307183144_745a3d9