Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

some types failing with cannot autoload file. #123

Open
shoekstra opened this issue Aug 5, 2013 · 4 comments
Open

some types failing with cannot autoload file. #123

shoekstra opened this issue Aug 5, 2013 · 4 comments

Comments

@shoekstra
Copy link

Hello,

Some types fail saying they cannot autoload a file. I want to assume it's trying to find rbvmomi under /var/lib/puppet/lib and cannot, but can't say for certain.

Example of failure:

  vcenter::dvswitch{ '/DC1/vDS':
    ensure    => present,
    transport => Transport['vcenter'],
    spec      => {}
  }

On puppet agent:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not autoload puppet/type/vc_cluster_ha: no such file to load -- rbvmomi on node puppet.server.tld

On puppet master (using debug):

Error: Could not autoload puppet/type/vc_dvswitch: no such file to load -- rbvmomi
Error: Could not autoload puppet/type/vc_dvswitch: no such file to load -- rbvmomi on node puppet.server.tld
Error: Could not autoload puppet/type/vc_dvswitch: no such file to load -- rbvmomi on node puppet.server.tld
Error: Could not autoload puppet/type/vc_dvswitch: no such file to load -- rbvmomi on node puppet.server.tld

So far seen vc_dvswitch and vc_cluster_ha fail with this error while other vc_cluster types work as expected.

The thing these two types have in common that other working types don't are the following lines at the start of the file:

require 'set'

require 'pathname' # WORK_AROUND #14073 and #7788

vmware_module = Puppet::Module.find('vmware_lib', Puppet[:environment].to_s)
require File.join vmware_module.path, 'lib/puppet_x/vmware/util'
module_lib = Pathname.new(__FILE__).parent.parent.parent.parent
require File.join module_lib, 'puppet/provider/vcenter'
require File.join module_lib, 'puppet_x/vmware/mapper'

Other working types have the following at the start of the file:

provider_path = Pathname.new(__FILE__).parent.parent
require File.join(provider_path, 'vcenter')

Unfortunately don't know enough ruby to troubleshoot further, but replacing the former with the latter does not work :) and such have raised issue as I would imagine this affects more than just me.

Some additional info:

  • Puppet 3.2.3 master and agent
  • Ruby 1.9.3
  • Ubuntu Precise LTS

If there is any additional information I can provide please let me know.

Stephen

@nanliu
Copy link
Contributor

nanliu commented Aug 5, 2013

@shoekstra
Copy link
Author

I believe so yes:

# gem list | grep rbvmomi
rbvmomi (1.6.0.z1)

All gems install correctly when including the vcenter::package class (after upgrading to ruby 1.9.3).

Because of the ruby => 1.9.2 requirement I've created a new VM for this rather than upgrading ruby on my puppetmaster. Should this be run from the puppetmaster node? I did try this but got the same autoload error.

@nanliu
Copy link
Contributor

nanliu commented Aug 5, 2013

This module was tested on Ruby 1.9.3 + Puppet 3.2.3 via puppet apply (not agent/master), the vmware_lib/vcenter module were both on the development branch. After reading the error a bit closer, it appears the master is trying to load rbvmomi gem during compile. Initially I didn't think that this should be the case due to:
https://github.com/vmware/vmware-vcenter/blob/master/lib/puppet_x/puppetlabs/transport/vsphere.rb#L2

After thinking about it some more, I think it's due to resource dependency against:
https://github.com/vmware/vmware-vmware_lib/blob/development/lib/puppet/property/vmware_array_vim_object.rb

Some of the resources type such as dv_switches were very complicated, and in order to model them we relied on introspecting VIM object returned by rbvmomi gem. This adds a dependency for rbvmomi gem on the puppet master, so please check the master and see if rbvmomi gem is installed. I'm hoping it doesn't require an active connection, just the gem. I probably will not have time to verify agent/master until we migrate our master to PE 3.0. We should definitely add a note about this change.

@cecilkootz
Copy link

I recently tried to create a dvswitch using the examples in tests/* but received an error regarding a few of the ones mentioned above.

from a local apply (puppet apply --noop vcenter.pp):
Error: Could not autoload puppet/type/vc_dvswitch: PuppetX::VMware::Mapper: Error accessing or creating mapper "VMwareDVSConfigSpecMap": uninitialized constant Puppet::Property::VMware_Array_VIM_Object
Error: Could not autoload puppet/type/vc_dvswitch: PuppetX::VMware::Mapper: Error accessing or creating mapper "VMwareDVSConfigSpecMap": uninitialized constant Puppet::Property::VMware_Array_VIM_Object on node lappy-dev.localdomain
Error: Could not autoload puppet/type/vc_dvswitch: PuppetX::VMware::Mapper: Error accessing or creating mapper "VMwareDVSConfigSpecMap": uninitialized constant Puppet::Property::VMware_Array_VIM_Object on node lappy-dev.localdomain

root@lappy-dev:~# gem list | grep rbvmomi
rbvmomi (1.6.0.z1)

root@lappy-dev:~# puppet --version
3.2.4

include vcenter::package

transport { 'vcenter':
  username  => 'root',
  password  => 'vmware',
  server    => '1.1.1.1',
  options   => { 'insecure' => true },
}

vcenter::dvswitch{ "/DC01/dvs1:create":
  ensure => present,
  transport => Transport['vcenter'],
}

I did grab a co this evening so I may have gotten an in-flight fix. Any ideas?

dmohanty09 referenced this issue in dmohanty09/vmware-vcenter Jun 20, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants