Project

General

Profile

Bug #10336

foreman-rake prints "Workaround for RbVmomi may not work as ComputeResource is already loaded: #{ComputeResource}"

Added by Elisiano Petrini over 6 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Compute resources
Target version:
Difficulty:
easy
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

The message is found in /usr/share/foreman/config/initializers/rbvmomi.rb (installed from RPM).

Having a look at the source code it seems that nothing else is done except printing that message. It doesn't cause any side effect except cron sending out mails every time a foreman-rake is run.

If it helps, this is what Dominic said on IRC:
[10:23:40] <Dominic> it's a bug in the codebase, I think it's because the fast_gettext.rb initialiser is running first and the log message isn't entirely accurate. we should probably move rbvmomi.rb "up"


Related issues

Related to Foreman - Bug #2680: Unable to provisioning host using UI - vSphere 4.1.0Closed2013-06-192013-06-20
Related to Foreman - Bug #9779: first host creation submit doesn't work using VMWare compute resourceResolved2015-03-16
Related to Foreman - Feature #4478: API docs need to be localizedClosed2014-02-27

Associated revisions

Revision 70bd0d26 (diff)
Added by Dominic Cleal over 6 years ago

fixes #10336 - move rbvmomi CR loading before our CR loading

Revision ed7430ba (diff)
Added by Dominic Cleal over 6 years ago

fixes #10336 - move rbvmomi CR loading before our CR loading

(cherry picked from commit 70bd0d265e82a42256d47a8f78456f9c41bdc577)

History

#1 Updated by Dominic Cleal over 6 years ago

  • Related to Bug #2680: Unable to provisioning host using UI - vSphere 4.1.0 added

#2 Updated by Dominic Cleal over 6 years ago

  • Category set to Compute resources

If it's what I suspect (untested) we could either:

  1. rename rbvmomi.rb so it comes before fast_gettext.rb
  2. make the test that prints the warning more intelligent, so it checks if it's our ComputeResource class

#3 Updated by Andrew F over 6 years ago

Dominic Cleal wrote:

If it's what I suspect (untested) we could either:

  1. rename rbvmomi.rb so it comes before fast_gettext.rb
  2. make the test that prints the warning more intelligent, so it checks if it's our ComputeResource class

This issue was prevented me from creating hosts with VMWare.

Renaming rbvmomi has fixed it for now. We are running the v1.8.0 RPM on RHEL 6.6
For reference, I ran the following and restarted the foreman service.

mv /usr/share/foreman/config/initializers/{,0_}rbvmomi.rb

From production.log:

2015-05-04 12:13:00 [W] Failed to create a compute <Compute Resource> (VMware) instance <hostname>: failed to create vm: undefined method >` resourcePool' for nil:NilClass
/opt/rh/ruby193/root/usr/share/gems/gems/fog-1.28.0/lib/fog/vsphere/requests/compute/create_vm.rb:28:in `rescue in create_vm'
/opt/rh/ruby193/root/usr/share/gems/gems/fog-1.28.0/lib/fog/vsphere/requests/compute/create_vm.rb:8:in `create_vm'
/opt/rh/ruby193/root/usr/share/gems/gems/fog-1.28.0/lib/fog/vsphere/models/compute/server.rb:232:in `save'
/usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:322:in `create_vm'

etc

#4 Updated by Dominic Cleal over 6 years ago

  • Related to Bug #9779: first host creation submit doesn't work using VMWare compute resource added

#5 Updated by The Foreman Bot over 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2382 added
  • Pull request deleted ()

#6 Updated by Dominic Cleal over 6 years ago

#7 Updated by Dominic Cleal over 6 years ago

  • Assignee set to Dominic Cleal
  • Legacy Backlogs Release (now unused) set to 50

Thanks for the info, that would explain why the error came back too, since this was originally added to fix the same error under #2680.

#8 Updated by Dominic Cleal over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF