Bug 1360132 - Automate | Quota error "undefined method `vendor' for #<MiqAeMethodService::MiqAeServiceServiceTemplate:
Summary: Automate | Quota error "undefined method `vendor' for #<MiqAeMethodService::M...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Provisioning
Version: 5.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: GA
: 5.5.6
Assignee: William Fitzgerald
QA Contact: Aziza Karol
URL:
Whiteboard: automate:quota
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-26 05:59 UTC by Aziza Karol
Modified: 2017-08-16 17:29 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-16 17:29:01 UTC
Category: Bug
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Aziza Karol 2016-07-26 05:59:32 UTC
Description of problem:


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

How reproducible:
100%

Steps to Reproduce:
1.Enforce CPU,Memory or storage quota for tenant "My Company" 
2.create a catalog item of type VMWARE  with template damnSmallLinux
Provisioning entry point used (/Service/Provisioning/StateMachines/ServiceProvision_Template/CatalogItemInitialization)
3.provision the service.

Actual results:
undefined method `vendor' for #<MiqAeMethodService::MiqAeServiceServiceTemplate:0x0000000a8f0bd8> is thrown in automation.log

Expected results:


Additional info:
automation.log
[----] I, [2016-07-26T01:55:03.875444 #3007:1151994]  INFO -- : <AEMethod [/ManageIQ/System/CommonMethods/QuotaMethods/requested]> Starting 
[----] E, [2016-07-26T01:55:03.957347 #3007:54e4030] ERROR -- : Method STDERR: -:77: warning: duplicated key at line 80 ignored: :storage
[----] I, [2016-07-26T01:55:04.637629 #3007:54df274]  INFO -- : <AEMethod requested> Request: Provisioning Service [vsphere_prov] from [vsphere_prov] id: 4 
[----] I, [2016-07-26T01:55:04.642716 #3007:54df274]  INFO -- : <AEMethod requested> Adding seq_id: 0 key: :dialog_textbox value: "test" to options_hash
[----] I, [2016-07-26T01:55:04.644755 #3007:54df274]  INFO -- : <AEMethod requested> Inspecting options_hash: {0=>{:dialog_textbox=>"test"}}
[----] I, [2016-07-26T01:55:04.658705 #3007:54df274]  INFO -- : <AEMethod requested> service_template id: 1 service_type: atomic
[----] E, [2016-07-26T01:55:04.669449 #3007:546d1d8] ERROR -- : <AEMethod requested> The following error occurred during method evaluation:
[----] E, [2016-07-26T01:55:04.670701 #3007:546d1d8] ERROR -- : <AEMethod requested>   NoMethodError: undefined method `vendor' for #<MiqAeMethodService::MiqAeServiceServiceTemplate:0x0000000a8f0bd8>
[----] E, [2016-07-26T01:55:04.672832 #3007:546d1d8] ERROR -- : <AEMethod requested>   (druby://127.0.0.1:33318) /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:179:in `method_missing'
(druby://127.0.0.1:33318) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1624:in `perform_without_block'
(druby://127.0.0.1:33318) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1584:in `perform'
(druby://127.0.0.1:33318) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1657:in `block (2 levels) in main_loop'
(druby://127.0.0.1:33318) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1653:in `loop'
(druby://127.0.0.1:33318) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1653:in `block in main_loop'
<code: storage = if @miq_request.source.vendor.downcase == 'google'>:16:in `calculate_requested'
[----] E, [2016-07-26T01:55:04.676838 #3007:54e4030] ERROR -- : Method STDERR: (druby://127.0.0.1:33318) /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:179:in `method_missing': undefined method `vendor' for #<MiqAeMethodService::MiqAeServiceServiceTemplate:0x0000000a8f0bd8> (NoMethodError)
[----] E, [2016-07-26T01:55:04.677024 #3007:54e4030] ERROR -- : Method STDERR: 	from (druby://127.0.0.1:33318) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1624:in `perform_without_block'
[----] E, [2016-07-26T01:55:04.677195 #3007:54e4030] ERROR -- : Method STDERR: 	from (druby://127.0.0.1:33318) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1584:in `perform'
[----] E, [2016-07-26T01:55:04.677457 #3007:54e4030] ERROR -- : Method STDERR: 	from (druby://127.0.0.1:33318) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1657:in `block (2 levels) in main_loop'
[----] E, [2016-07-26T01:55:04.677682 #3007:54e4030] ERROR -- : Method STDERR: 	from (druby://127.0.0.1:33318) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1653:in `loop'
[----] E, [2016-07-26T01:55:04.677876 #3007:54e4030] ERROR -- : Method STDERR: 	from (druby://127.0.0.1:33318) /opt/rh/rh-ruby22/root/usr/share/ruby/drb/drb.rb:1653:in `block in main_loop'
[----] E, [2016-07-26T01:55:04.678119 #3007:54e4030] ERROR -- : Method STDERR: 	from <code: storage = if @miq_request.source.vendor.downcase == 'google'>:16:in `calculate_requested'
[----] E, [2016-07-26T01:55:04.678286 #3007:54e4030] ERROR -- : Method STDERR: 	from <code: $evm.root['quota_requested'] = calculate_requested(options_hash)>:253:in `<main>'
[----] I, [2016-07-26T01:55:04.720641 #3007:1151994]  INFO -- : <AEMethod [/ManageIQ/System/CommonMethods/QuotaMethods/requested]> Ending
[----] E, [2016-07-26T01:55:04.721305 #3007:1151994] ERROR -- : Aborting instantiation (unknown method return code) because [Method exited with rc=Unknown RC: [1]]
[----] E, [2016-07-26T01:55:04.721501 #3007:1151994] ERROR -- : State=<requested> running  raised exception: <Method exited with rc=Unknown RC: [1]>
[----] W, [2016-07-26T01:55:04.721901 #3007:1151994]  WARN -- : Error in State=[requested]
[----] I, [2016-07-26T01:55:04.722583 #3007:1151994]  INFO -- : Followed  Relationship [miqaedb:/System/CommonMethods/QuotaStateMachine/quota#create]
[----] I, [2016-07-26T01:55:04.722762 #3007:1151994]  INFO -- : Processed  State=[ValidateRequest] with Result=[error]

Comment 2 Aziza Karol 2016-07-26 06:03:14 UTC
This issue was fix in 5.6 -https://bugzilla.redhat.com/show_bug.cgi?id=1336925.

Comment 3 Aziza Karol 2016-07-26 11:11:35 UTC
Also observed that when that request is approved manually, the vm is provision even when quota is enforced.

Comment 4 William Fitzgerald 2016-07-27 14:28:51 UTC
Aziza,

Can I have access to your appliance ?

Thanks

Billy

Comment 6 William Fitzgerald 2016-07-29 14:06:01 UTC
Aziza,

Can I do some testing on your Appliance?  

Thanks

Billy

Comment 7 Aziza Karol 2016-08-01 05:02:33 UTC
Billy,

You can test on my appliance. It's all yours.


~Thanks,
Aziza

Comment 8 William Fitzgerald 2016-08-01 19:09:45 UTC
Aziza,

I tried a newer requested.rb and it worked.

 I created a Billy Domain on your appliance with the newer requested.rb in there (\System\CommonMethods\QuotaMethods\).  I tested with your requested.rb and the service provision failed.  With the newer method enabled, it worked.
I also tested a vm provision with and without the new method and they both worked.
I left the Billy Domain there (Disabled now) in case you wanted to see it. 

Thanks

Billy

Comment 9 Tina Fitzgerald 2016-08-04 14:57:30 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=86c546e3c0e79e117a6577cd0238676ff923a8e3

commit 86c546e3c0e79e117a6577cd0238676ff923a8e3
Author:     william fitzgerald <wfitzger>
AuthorDate: Fri May 20 12:36:08 2016 -0400
Commit:     Tina Fitzgerald <tfitzger>
CommitDate: Wed Aug 3 14:46:11 2016 -0400

    Automate - Fixed service quota
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1336925
    
    Added Service provisioning spec tests for generic and vmware service items.
    
    Updated spec helper files.
    
    Conflicts:
    	db/fixtures/ae_datastore/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/requested.rb
    	spec/automation/unit/method_validation/calculate_requested_spec.rb
    	spec/support/quota_helper.rb

 .../QuotaMethods.class/__methods__/requested.rb    | 55 ++++++++++++--------
 .../method_validation/calculate_requested_spec.rb  | 58 ++++++++++++++++------
 spec/support/quota_helper.rb                       | 57 +++++++++++++++++++--
 spec/support/service_template_helper.rb            | 10 ++--
 4 files changed, 137 insertions(+), 43 deletions(-)

Comment 10 Tina Fitzgerald 2016-08-04 16:00:16 UTC
Changes based on:
https://bugzilla.redhat.com/show_bug.cgi?id=1336925

Comment 11 Chris Pelland 2017-08-16 17:29:01 UTC
This bug has been open for more than a year and is assigned to an older release of CloudForms. 

If you would like to keep this Bugzilla open and if the issue is still present in the latest version of the product, please file a new Bugzilla which will be added and assigned to the latest release of CloudForms.


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