Bug #2612
closedVirtualMachine Tab empty when trying to create VM using fog 1.8.0-3 or 1.11.1
Description
- VMWare Esxi 5.0.0 managed by VSphere (VMware vCenter Server 5.0.0.16964)
- CentOS release 6.2 (Final)
- Foreman 1.2 RC1 without passenger/ssl
VirtualMachine TAB empty when trying to create Vmware VM with foreman 1.2 RC1. ((Using old Fog 1.8.0-3 (in RC1 yum repo) and newer fog-1.11-1 from http://koji.katello.org)
In /var/log/foreman/production.log.
Started GET "/hosts/user.jpg" for 192.168.88.1 at 2013-06-04 09:47:14 -0700
Processing by HostsController#show as HTML
Parameters: {"id"=>"user.jpg"}
Rendered common/404.html.erb within layouts/application (0.7ms)
Rendered home/_user_dropdown.html.erb (1.2ms)
Read fragment views/tabs_and_title_records-1 (0.2ms)
Rendered home/_topbar.html.erb (1.3ms)
Filter chain halted as :find_by_name rendered or redirected
Completed 404 Not Found in 12ms (Views: 6.1ms | ActiveRecord: 0.9ms)
Started POST "/hosts/compute_resource_selected" for 192.168.88.1 at 2013-06-04 09:47:18 -0700
Processing by HostsController#compute_resource_selected as */*
Parameters: {"architecture_id"=>"", "compute_resource_id"=>"1", "operatingsystem_id"=>""}
Rendered compute_resources_vms/form/_vmware.html.erb (162.0ms)
Rendered hosts/_compute.html.erb (201.9ms)
Operation FAILED: undefined method `init' for #<Class:0x000000081328d0>
Rendered common/500.html.erb (11.0ms)
Completed 500 Internal Server Error in 226ms (Views: 13.3ms | ActiveRecord: 0.0ms)
Connecting to database specified by database.yml
cat /usr/share/foreman-installer/foreman_installer/answers.yaml
---
foreman:
ssl: false
passenger: false
foreman_proxy:
dns: true
dhcp: true
puppetca: true
tftp: true
puppetrun: true
puppetmaster: true
puppet: true
Attached debug log (test with fog-1.11.1):
Files
Updated by Ronny M about 11 years ago
- File foreman-vmware.png foreman-vmware.png added
Updated by Dominic Cleal about 11 years ago
- Category set to Compute resources
- Status changed from New to Need more information
- Target version set to 1.2.0
Can you try enabling debug logging and then attach /var/log/foreman/production.log again please? It should create a long stack trace in the log file when you attempt selecting the compute resource.
Enabling debug logging: http://projects.theforeman.org/wiki/foreman/Troubleshooting#How-do-I-enable-debugging
Updated by Ronny M about 11 years ago
Updated by Ohad Levy about 11 years ago
any chance you can turn on debugging (see in troubleshooting) and paste the same output?
Updated by Ohad Levy about 11 years ago
hmm.. did you restart and tried to do the same action again? I cant see it in the logs?
Updated by Ronny M about 11 years ago
- File production-debug.log production-debug.log added
Updated by Ronny M about 11 years ago
Ohad Levy wrote:
hmm.. did you restart and tried to do the same action again? I cant see it in the logs?
Yes, but had not uploaded the log yet :)
Updated by Ohad Levy about 11 years ago
which kind of vmware are you do you have clusters support? (the trace shows it fails listing the clusters).
do you have any localization version of vmware etc? did it ever worked with foreman?
Updated by Ronny M about 11 years ago
Ohad Levy wrote:
which kind of vmware are you do you have clusters support? (the trace shows it fails listing the clusters).
do you have any localization version of vmware etc? did it ever worked with foreman?
VMWare Esxi 5.0.0 managed by VSphere (VMware vCenter Server 5.0.0.16964) First list of the BUG Desription :)
Cluster is named thuis. (dutch for home) My whole setup is running on wmware-workstation 9.0.2
Same setup does work with foreman 1.1
Updated by Ronny M about 11 years ago
Ronny M wrote:
Ohad Levy wrote:
which kind of vmware are you do you have clusters support? (the trace shows it fails listing the clusters).
do you have any localization version of vmware etc? did it ever worked with foreman?
VMWare Esxi 5.0.0 managed by VSphere (VMware vCenter Server 5.0.0.16964) First list of the BUG Desription :)
Cluster is named thuis. (dutch for home) My whole setup is running on wmware-workstation 9.0.2
Same setup does work with foreman 1.1
Foreman 1.1 uses fog-1.9.0. Foreman 1.2 tested with fog-1.8.0-3 (in rc1 yum repo an with 1.1.11-3)
Updated by Ronny M about 11 years ago
Added debug log using fog-1.8.0-3.
Updated by Dominic Cleal about 11 years ago
Thanks for the log files, that's very useful.
Updated by Dominic Cleal about 11 years ago
- Status changed from Need more information to New
Updated by Ronny M about 11 years ago
Added log using foreman 1.1 with fog 1.9.0 (which does work). The same action with foreman 1.2 doesn't work.
Updated by Ronny M about 11 years ago
Tested also with foreman 1.2 RC2.
Now a empty screen with only the following error on the virtual machine TAB when trying to create a new host:
Error loading virtual machine information: Internal Server Error
Attached also the debug log when this error occurred.
Updated by Ronny M about 11 years ago
- File fog-1.9.0-foreman1.1-stable.txt fog-1.9.0-foreman1.1-stable.txt added
- File fog-1.11.1-foreman1.2-RC2.txt fog-1.11.1-foreman1.2-RC2.txt added
I'm not an expert but it looks like it's fog related.
fog 1.9.0 installed with foreman 1.1-stable is able to list servers when using fog on linux prompt. (attachment: fog-1.9.0-foreman1.1-stable)
fog 11.1.1 installed with foreman 1.2 RC2 results in: (Object doesn't support #inspect) for same command to list servers. (attachment: fog-1.11.1-foreman1.2-RC2)
attached for both situations.
Updated by Ronny M about 11 years ago
Ronny M wrote:
I'm not an expert but it looks like it's fog related.
fog 1.9.0 installed with foreman 1.1-stable is able to list servers when using fog on linux prompt. (attachment: fog-1.9.0-foreman1.1-stable)
fog 11.1.1 installed with foreman 1.2 RC2 results in: (Object doesn't support #inspect) for same command to list servers. (attachment: fog-1.11.1-foreman1.2-RC2)attached examples/logs for both situations.
Updated by Ronny M about 11 years ago
Also tested with foreman-1.2 RC1 fog-1.8.0-3.
This time fog returns an empty list.
<Fog::Compute::Vsphere::Serversf.servers
[]
>
attached example/log with name: fog-1.8.0-3-foreman-1.2-RC1
Updated by Ronny M about 11 years ago
Although it doesn't list servers it does see vmware templates. (Also in the foreman GUI: Provisioning => Compute resources => vmware => Virtual machines)
Updated by Ohad Levy about 11 years ago
what is the version of rbvmomi gem? it looks like we might have the wrong version in 1.2 vs 1.1?
Updated by Ronny M about 11 years ago
ruby193-rubygem-rbvmomi-1.2.3-7.el6.noarch
Updated by Dominic Cleal about 11 years ago
- Status changed from New to Assigned
- Assignee set to Dominic Cleal
Thanks, we think this is far too old, as even 1.1 shipped 1.5.1. I'm trying to build a new version at the moment, will let you know when it's available to test.
Updated by Ronny M about 11 years ago
The above version is of foreman 1.2 RC2
foreman 1.1-stable has rubygem-rbvmomi-1.5.1-1.el6.noarch
So you might be right the one in 1.2 is older then the one in 1.1.
Updated by Ronny M about 11 years ago
Ok, it will test it as soon as the new version is availible
Updated by Dominic Cleal about 11 years ago
- Status changed from Assigned to Feedback
Here's the updated RPM, just download and upgrade it, then restart Foreman (or httpd if using passenger).
Let me know how you get on.
Updated by Ronny M about 11 years ago
Virtual Machine Tab now shows VM Settings/Details.
But during creation of the VM I get the following error
Unable to save
Failed to create a compute vmware (VMWare) instance bla4.local.domain: failed to create vm: unexpected type Task (Task/Object/Foreman::Util/PSON::Pure::Generator::GeneratorMethods::Object/GettextI18nRails::HtmlSafeTranslations/FastGettext::Translation/PP::ObjectMixin/ActiveSupport::Dependencies::Loadable/JSON::Ext::Generator::GeneratorMethods::Object/Kernel/BasicObject)
Although there is an error the VM is created in VMWARE but not powered up.
VM Is also not created as host in foreman.
Attached debug log: production_rbvmomi-1.6.0-1
Updated by Peter Gustafsson about 11 years ago
I'm hitting the same issue using foreman 1.2 rc.2 and vmware ESXi, 5.1.0,914609. I have updated rbvmomi as above and can now se VM Settings/Details. But when creating a new VM i get.
Failed to create a compute vmware (VMWare) instance rhidm.example.com: failed to create vm: unexpected type Task (Task/Object/Foreman::Util/PSON::Pure::Generator::GeneratorMethods::Object/GettextI18nRails::HtmlSafeTranslations/FastGettext::Translation/PP::ObjectMixin/ActiveSupport::Dependencies::Loadable/JSON::Ext::Generator::GeneratorMethods::Object/Kernel/BasicObject)
Updated by Dominic Cleal about 11 years ago
- Status changed from Feedback to New
- Assignee deleted (
Dominic Cleal) - Priority changed from Normal to High
Updated by Ronny M about 11 years ago
Although not all of the following rpm's are installed in both foreman 1.1 and 1.2, the ones in foreman 1.2 are also older then the onces in foreman 1.1
Not sure if this is what causes the problems but expected newer rpm's in foreman 1.2
- foreman 1.1:
rubygem-ffi-1.0.11-1.el6.x86_64.rpm
rubygem-json-1.6.8-1.el6.x86_64.rpm
rubygem-net-ldap-0.3.1-1.el6.noarch.rpm
rubygem-pg-0.13.2-2.el6.x86_64.rpm
rubygem-rest-client-1.6.7-1.el6.noarch.rpm
- foreman 1.2:
ruby193-rubygem-ffi-1.0.9-10.el6.x86_64.rpm
ruby193-rubygem-json-1.5.4-29.el6.x86_64.rpm
ruby193-rubygem-net-ldap-0.2.2-5.el6.noarch.rpm
ruby193-rubygem-pg-0.12.2-8.el6.x86_64.rpm
ruby193-rubygem-rest-client-1.6.1-4.el6.noarch.rpm
Updated by Ronny M about 11 years ago
Any plans to build newer versions for the 1.2 RC2 rpm's mentioned above?
I'm happily willing to test them as soon as they come available.
Updated by Ronny M about 11 years ago
Any plans to build newer versions for the 1.2 RC2 rpm's mentioned above?
I'm happily willing to test them as soon as they come available.
Updated by Dominic Cleal about 11 years ago
I hadn't planned on building them as they don't look directly related. Amos is planning to look at this on an RPM build to see if he can reproduce it, if any of them look like likely suspects then we'll try some rebuilds.
Updated by Dominic Cleal about 11 years ago
- Status changed from New to Assigned
- Assignee set to Dominic Cleal
Reproduced this issue now.
Updated by Dominic Cleal about 11 years ago
I think this is due to a bug in rbvmomi 1.6.0, as I went and built the latest release when we found it was out of date above. I've applied a patch from upstream that was committed since the release and it seems to help on my local development setup, here's a test RPM build for you to try:
If that doesn't help, I could go back and build 1.5.1, but I'd like to avoid that as it means yum downgrades or epoch numbers.
My RHEL 6 instance is now getting the error "failed to create vm: undefined method `resourcePool' for nil:NilClass", so I'll look into this next.
Updated by Ronny M about 11 years ago
Doesn't work for me either. With Folder on: "VM Folder" I get the following error on my first attempt to create a new VM after updating rvbcomi to 1.6.0-2.
Unable to save
Failed to create a compute vmware (VMWare) instance test300.local.domain: failed to create vm: undefined method `resourcePool' for nil:NilClass
But when I try to create another VM with different name and ip after above error occurred I get the following error again:
Unable to save
Failed to create a compute vmware (VMWare) instance test400.local.domain: failed to create vm: unexpected type Task (Task/Object/Foreman::Util/PSON::Pure::Generator::GeneratorMethods::Object/GettextI18nRails::HtmlSafeTranslations/FastGettext::Translation/PP::ObjectMixin/ActiveSupport::Dependencies::Loadable/JSON::Ext::Generator::GeneratorMethods::Object/Kernel/BasicObject)
But With Folder on: "vm/Servers" during a first attempt after updating the rpm I get the following error right away:
Unable to save
Failed to create a compute vmware (VMWare) instance hallo.local.domain: failed to create vm: unexpected type Task (Task/Object/Foreman::Util/PSON::Pure::Generator::GeneratorMethods::Object/GettextI18nRails::HtmlSafeTranslations/FastGettext::Translation/PP::ObjectMixin/ActiveSupport::Dependencies::Loadable/JSON::Ext::Generator::GeneratorMethods::Object/Kernel/BasicObject)
Updated by Dominic Cleal about 11 years ago
- Status changed from Assigned to Ready For Testing
Ignore that, I think it was a red herring. Sorry for wasting your time testing that Ronny.
Comparing the rbvmomi deserialisation behaviour in the test harness to the error, I think it's loading the wrong "Task" class. We're probably hitting this now because of the switch from Ruby 1.8 to 1.9.
Compare and contrast the ancestors of the RbVmomi::VIM::Task class with those in the error message:
2.0.0p0 :015 > self.class.const_get('RbVmomi::VIM::Task').ancestors => [RbVmomi::VIM::Task, RbVmomi::VIM::ExtensibleManagedObject, RbVmomi::BasicTypes::ManagedObject, RbVmomi::BasicTypes::ObjectWithMethods, RbVmomi::BasicTypes::ObjectWithProperties, RbVmomi::BasicTypes::Base, Object, Metaclass::ObjectMethods, Mocha::ObjectMethods, Foreman::Util, PSON::Pure::Generator::GeneratorMethods::Object, GettextI18nRails::HtmlSafeTranslations, FastGettext::Translation, V8::Conversion::Object, PP::ObjectMixin, ActiveSupport::Dependencies::Loadable, JSON::Ext::Generator::GeneratorMethods::Object, Kernel, BasicObject] 2.0.0p0 :010 > self.class.const_get('Task').ancestors => [Task, Object, Metaclass::ObjectMethods, Mocha::ObjectMethods, Foreman::Util, PSON::Pure::Generator::GeneratorMethods::Object, GettextI18nRails::HtmlSafeTranslations, FastGettext::Translation, V8::Conversion::Object, PP::ObjectMixin, ActiveSupport::Dependencies::Loadable, JSON::Ext::Generator::GeneratorMethods::Object, Kernel, BasicObject]
Since Task isn't namespaced, the const_get in rbvmomi is often(?!) hitting ours. The error we see in above (Ronny's comment 27) is a printout of the ancestors as rbvmomi can't find the RbVmomi::BasicTypes::ManagedObject ancestors because it's found our Task class.
Updated by Ronny M about 11 years ago
Dominic,
You are right.
I applied you pull request into my setup and know creating a VM does work :)
Updated by Dominic Cleal about 11 years ago
Ronny M wrote:
I applied you pull request into my setup and know creating a VM does work :)
Thank you for testing!
Updated by Ronny M about 11 years ago
Ronny M wrote:
Dominic,
You are right.
I applied you pull request into my setup and now creating a VM does work :)
Updated by Ronny M about 11 years ago
Oeps sorry,
Correcting a typo in my comment duplicated my comment :(
Updated by Dominic Cleal about 11 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 467ea135da2b2309d306fd7e97d5c52a9ab00dbe.