Failed to create vm with vsphere integration (Could not descend into . Please check your path.)

Hi,
I think I can provide a fix that would get rid of this "english"
dependency. For me it worked with the German localization without problems.
I made a github pull request against latest fog code:

See diff
diff --git a/lib/fog/vsphere/requests/compute/get_folder.rb
b/lib/fog/vsphere/requests/compute/get_folder.rb
index cb3b7f8…733d448 100644
— a/lib/fog/vsphere/requests/compute/get_folder.rb
+++ b/lib/fog/vsphere/requests/compute/get_folder.rb
@@ -27,9 +27,11 @@ module Fog
# The required path syntax - 'topfolder/subfolder

       # Clean up path to be relative since we're providing datacenter 

name

  •      paths          = 
    

path.sub(/^/?Datacenters/#{datacenter_name}/vm/?/, '').split('/')
dc = find_raw_datacenter(datacenter_name)
dc_root_folder = dc.vmFolder

  •      # Filter the root path for this datacenter not to be used."
    
  •      dc_root_folder_path=dc_root_folder.path.map { | id, name | name 
    

}.join("/")

  •      paths          = path.sub(/^\/?#{dc_root_folder_path}\/?/, 
    

'').split('/')

       return dc_root_folder if paths.empty?
       # Walk the tree resetting the folder pointer as we go

I'm not (yet) a big ruby hero so my solution might appear to be clumsy but
I think it shows the basic idea.

Shall I also open up some issue for fog?

Thanks Marc.

··· Am Donnerstag, 14. Februar 2013 14:24:23 UTC+1 schrieb Marc Grimme: > > Hi, > I tried to integrated VMware vSphere into foreman (1.1) with RHEL6. > I could successfully set up foreman (from the installer) and everything is > running just fine so far. > > I then integrated the test vSphere installation (all 5.1.0a) into foreman > and it also looked quite ok (No failures so far). Added the compute > resource successfully. > > But when I try to create a new vm I get the following error while foreman > is trying to create the vm. > From the logs I could gather the following information: > > Adding Compute instance for mg-vmware-test1.qa.atix > Failed to create a compute axref201.qa.atix (VMWare) instance > mg-vmware-test1.qa.atix: failed to create vm: Could not descend into . > Please check your path. /Datencenter/axref200/vm/Linux > /usr/lib/ruby/gems/1.8/gems/fog-1.9.0/lib/fog/vsphere/requests/compute/create_vm.rb:26:in > `create_vm' > /usr/lib/ruby/gems/1.8/gems/fog-1.9.0/lib/fog/vsphere/models/compute/server.rb:172:in > `save' > /usr/share/foreman/lib/foreman/model/vmware.rb:86:in `create_vm' > /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/associations/association_proxy.rb:227:in > `send' > /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/associations/association_proxy.rb:227:in > `method_missing' > /usr/share/foreman/app/models/orchestration/compute.rb:59:in `setCompute' > /usr/share/foreman/app/models/orchestration.rb:151:in `send' > /usr/share/foreman/app/models/orchestration.rb:151:in `execute' > /usr/share/foreman/app/models/orchestration.rb:91:in `process' > /usr/share/foreman/app/models/orchestration.rb:83:in `each' > /usr/share/foreman/app/models/orchestration.rb:83:in `process' > /usr/share/foreman/app/models/orchestration.rb:21:in `on_save' > /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.20/lib/active_support/callbacks.rb:520:in > `_run_save_callbacks' > /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/callbacks.rb:273:in > `create_or_update' > /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/persistence.rb:40:in > `save' > /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/validations.rb:43:in > `save' > /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/attribute_methods/dirty.rb:21:in > `save' > /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/transactions.rb:240:in > `save' > /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/transactions.rb:292:in > `with_transaction_returning_status' > .. > > Looks like somehow the program cannot descend into the appropriate VM > folder on the vSphere server.. > > Any ideas on how to proceed from here? > > Thanks for your help > Marc. >