Bug #17883

Problem with resource pool vCenter 5.5

Added by Alexandre JARC 10 months ago. Updated 4 months ago.

Status:Closed
Priority:Normal
Assigned To:Marek Hulán
Category:Compute resources - VMware
Target version:Team Marek Iteration 14
Difficulty: Bugzilla link:1427319
Found in release:1.14.0 Pull request:https://github.com/theforeman/foreman/pull/4526
Story points-
Velocity based estimate-
Release1.16.0Release relationshipAuto

Description

Hi,
I'm not really good in english, so excuse me !

When i want to create a new host, everything is ok (i see every cluster, lun, lan etc...) but i can't see my resource pool...
I just have this message : undefined method `resourcePool' for nil:NilClass

vCenter version : 5.5
Foreman : 1.14.0-RC2
I don't find the solution... Thank for your help.

production-create host.log.txt Magnifier (23.6 KB) Alexandre JARC, 12/30/2016 09:54 AM

production-select cluster.log.txt Magnifier (13.6 KB) Alexandre JARC, 12/30/2016 09:54 AM

production.log (1.95 MB) Alexandre JARC, 12/30/2016 10:06 AM

image2.png (9.58 KB) Preview Alexandre JARC, 01/03/2017 04:36 AM

image1.png (13.2 KB) Preview Alexandre JARC, 01/03/2017 04:36 AM

output_script.txt Magnifier (556 Bytes) Alexandre JARC, 01/10/2017 11:22 AM

Image2 Image1

Associated revisions

Revision 89d479d1
Added by Marek Hulán 5 months ago

Fixes #17883 - enforce newer fog-vsphere

Revision 83fab3d4
Added by Dominic Cleal 5 months ago

refs #17883 - use newer fog-vsphere

History

#1 Updated by Michael Moll 10 months ago

Please find the corresponding error line in /var/log/foreman/production.log and paste it here, including the whole backtrace.

#2 Updated by Alexandre JARC 10 months ago

I add three production.log. When i select cluster, when i try to create the host and the entire production.log.

I find this in production-select cluster :

2016-12-30T15:49:56 607767ca [app] [I] Parameters: {"cluster_id"=>"Lomaco (Figeac)/Cluster Clients", "id"=>"1-vCenter Caelis"}
2016-12-30T15:49:56 607767ca [app] [W] Action failed | Fog::Compute::Vsphere::NotFound: Fog::Compute::Vsphere::NotFound

And

2016-12-30T15:49:56 607767ca [app] [I] Rendered common/500.html.erb (4.3ms)
2016-12-30T15:49:56 607767ca [app] [I] Completed 500 Internal Server Error in 283ms (Views: 5.2ms | ActiveRecord: 2.6ms)

And this in production-create host :

2016-12-30T15:51:54 607767ca [app] [W] Échec de création de l'instance pedro-perra.exploitation.lomaco.fr sur la ressource de calcul vCenter Caelis (VMware) : undefined method `resourcePool' for nil:NilClass | NoMethodError: undefined method `resourcePool' for nil:NilClass

I don't how if this can help you... But thank a lot !

#3 Updated by Michael Moll 10 months ago

Is there some nested folder structure regarding clusters or resource pools configured in that setup?

#4 Updated by Alexandre JARC 10 months ago

On my vCenter i just have two cluster and one ressource pool in one of them. (Create just to foreman)

I configure my vCenter with the GUI in Compute Resource. (By using the administrator account). That's all.
I have created a resource pool in my cluster Lomaco called "Ressource", however by default foreman should normally see a pool called "Resource" and i can't see him.

Can we force the detection of the pool or something ?

Thank a lot

#5 Updated by Alexandre JARC 10 months ago

Btw, before i select my cluster, i can roll the resource pool menu (With "No Matches Found").(image(1))
But when i select a cluster, i have this message :

2017-01-03T10:29:42 907af286 [app] [I] Rendered common/500.html.erb (3.2ms)
2017-01-03T10:29:42 907af286 [app] [I] Completed 500 Internal Server Error in 286ms (Views: 4.0ms | ActiveRecord: 2.3ms)

And after that i can't roll in the menu. (image(2))

#6 Updated by Michael Moll 10 months ago

Timo, any idea on that?

#7 Updated by Timo Goebel 10 months ago

Michael Moll wrote:

Timo, any idea on that?

Yeah, it might just be the folder structure. But that's just a hunch and I don't have an environment to confirm this.

Alexandre, if I'd give you some debugging commands. Could you run them for me and show me the results?

#8 Updated by Alexandre JARC 10 months ago

Timo Goebel wrote:

Michael Moll wrote:

Timo, any idea on that?

Yeah, it might just be the folder structure. But that's just a hunch and I don't have an environment to confirm this.

Alexandre, if I'd give you some debugging commands. Could you run them for me and show me the results?

Of course, everything you want !

#9 Updated by Alexandre JARC 10 months ago

Hi guys, happy new year.

Do you have any idea since the last time ?
Which command do you want me to execute ?

Thank a lot, have a nice day

#10 Updated by Timo Goebel 10 months ago

Alexandre JARC wrote:

Which command do you want me to execute ?

I have prepared a little script to collect some some debug information:

https://gist.github.com/timogoebel/67ed5d62b02d2a125c07a0d96c249338

Could you run it and provide the output? That should help in pinpointing this.
It runs fine in my environment with vSphere 6.0. But it was working fine with 5.5 as well.

I think, the problem is that fog-vsphere is unable to resolve the cluster through fog-vsphere:

| Fog::Compute::Vsphere::NotFound: Fog::Compute::Vsphere::NotFound
| /usr/share/foreman/vendor/ruby/2.3.0/gems/fog-vsphere-1.5.2/lib/fog/vsphere/requests/compute/get_cluster.rb:7:in `get_cluster'

My gut feeling is, that either the nesting (Lomaco (Figeac)/Cluster Clients) or the special characters (the brackets) make problems. Alexandre, can you try to get rid of these problems?

#11 Updated by Alexandre JARC 10 months ago

Hi.

I joined the output of the script.
Also, i just created a new datacenter and new cluster on my vCenter without "( )" aaaand.... surprise ! It's works... I can see the default resource pool of vCenter.

I don't know if we can change the name without having a problem with our infrastructure, I'm waiting information from our vmware administrator.
In case it's not possible, do you have any idea to resolve this ? (I know, it's really dumb to have put ( ) right here...)

Thank a lot !

#12 Updated by Timo Goebel 10 months ago

Alexandre JARC wrote:

In case it's not possible, do you have any idea to resolve this ? (I know, it's really dumb to have put ( ) right here...)

I don't, do be honest. I believe the issue is in the library rbvmomi. fog-vsphere just passes the parameters through to rbvmomi. I don't know rbvmomi well enough to help.

I'd suggest opening an issue for rbvmomi. Describe, that you have a problem with the parenthesis and show them the relevant parts from my test script + the output.
They should be able to help.

https://github.com/vmware/rbvmomi/issues

#13 Updated by Karl Vallot 10 months ago

Hi,
I've got the same problem but I haven't got "()" in the name of my datacenter or in the name of my cluster.
I've just got "-" in the name of my cluster, do you think the problem may be that ?
Thanks for your help.

#14 Updated by Alexandre JARC 10 months ago

I just try, and with an "-" in the datacenter name it's ok. :)

Thank a lot for every answers.

#15 Updated by Karl Vallot 10 months ago

Thank you for your answer, but the "-" is in the Cluster name and I still can't see the Pools in foreman.
Has some one got a other idea ?

#16 Updated by Marek Hulán 8 months ago

  • Target version set to Team Marek backlog

#17 Updated by Marek Hulán 8 months ago

  • Tracker changed from Support to Bug
  • Bugzilla link set to 1427319

#18 Updated by Marek Hulán 6 months ago

  • Status changed from New to Assigned
  • Assigned To set to Marek Hulán
  • Target version changed from Team Marek backlog to Team Marek Iteration 13

I believe I found the issue in fog-vsphere. I sent a patch to this project. We'll need to bump the version after new version is released. Any character that has special meaning in regular expression that was used in data center name would cause similar issues.

See https://github.com/fog/fog-vsphere/pull/85 for more details and status.

#19 Updated by Marek Hulán 6 months ago

  • Target version changed from Team Marek Iteration 13 to Team Marek Iteration 14

#20 Updated by Marek Hulán 5 months ago

The PR has been merged and released in fog-vsphere 1.9.2. Update in packaging opened as https://github.com/theforeman/foreman-packaging/pull/1650, once it gets merged we can bump the dependency in Foreman which will fix this issue.

#21 Updated by The Foreman Bot 5 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4526 added

#22 Updated by Marek Hulán 5 months ago

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

#23 Updated by Marek Hulán 4 months ago

  • Release set to 1.16.0

#24 Updated by Karl Vallot 4 months ago

Hi,
I upgraded foreman from the version 12 to 15 and never found the solution to see the pools in Vsphere.
I changed the folder : bundler.d/vmware.rb from 1.7.0 to 1.9.2 like you said ; But I already use the version 1.10 so that's not the solution.
I created a pool name with just letters and still not working.
Could you please give me a solution.
Thank you very much.

PS : I have got one idea... Is it possible that we need the version 2.1 of ruby for fog-vsphere to work knowing that the version 2.1 is not avalible on ubuntu 14.04 ?
I still dont understand why it just can't recover the pool name like foreman recovers the names of the clusters and the folders (If you could indent the folders it would be great too)

Also available in: Atom PDF