Error : Import Template Vcenter (Opennebula 5.4)

Hello all

Since the last update (fresh install), i have error for importing VM template from a Vcenter 6.0.

Here is the output :
Reason: undefined method _ref' for nil:NilClass ["/usr/lib/one/ruby/vcenter_driver/virtual_machine.rb:237:inblock in import_vcenter_disks’", “/usr/lib/one/ruby/vcenter_driver/virtual
_machine.rb:236:in each'", "/usr/lib/one/ruby/vcenter_driver/virtual_machine.rb:236:inimport_vcenter_disks’”, “/usr/lib/one/ruby/vcen
ter_driver/importer.rb:430:in block (2 levels) in import_templates'", "/usr/lib/one/ruby/vcenter_driver/importer.rb:298:ineach’”, “/u
sr/lib/one/ruby/vcenter_driver/importer.rb:298:in block in import_templates'", "/usr/lib/one/ruby/vcenter_driver/importer.rb:286:inea
ch’”, “/usr/lib/one/ruby/vcenter_driver/importer.rb:286:in import_templates'", "/usr/bin/onevcenter:128:inblock (2 levels) in '
”, “/usr/lib/one/ruby/cli/command_parser.rb:449:in run'", "/usr/lib/one/ruby/cli/command_parser.rb:76:ininitialize’”, “/usr/bin/onevc
enter:57:in new'", "/usr/bin/onevcenter:57:in'”]

It was working great on Opennebula 5.2.

I have no idea to resolve this issue …

Thanks for your help.

Maybe your VM Template has spaces in their disks VMDK’s paths, this prevents the correct import of the template:

https://dev.opennebula.org/issues/5288

Hi Tino,

I confirm that the VMDK paths contains spaces.

I try to remove it.

Thanks

Hum, unfortunately i got the same error . (same with all kind of template)

Please take into account that the path to the VMDK in the datastore cannot have spaces at well, is that the case?

My vCenter is hosted by a tier . I’m not able to confirm that the full path is without spaces …

Hi Tino,

i got the information:

Here the full path of my VMDK template :

/vmfs/volumes/24c09254-03888e94/ubuntu-template-context/ubuntu-template-context-000001.vmdk

no spaces as well

Hi Tino,

I tried with vOneCloud appliance and GUI import template . Same error.

Is it in a regular datastore? or it in a VApp?

it is a NFS Datastore.

it worked well on 5.2 version

i try in a new “Ressource Pool”

same error

Hello Team ,
For information , i tried the new vOneCloud release 3.0.2 and got the same error … :cry:

Could you paste the error message again? Most likely the lines have changed. Thanks.

Here is :

There was an error trying to create an image for disk in vcenter template. Reason: undefined method _ref' for nil:NilClass ["/usr/lib/one/ruby/vcenter_driver/virtual_machine.rb:240:inblock in import_vcenter_disks’", “/usr/lib/one/ruby/vcenter_driver/virtual_machine.rb:239:in each'", "/usr/lib/one/ruby/vcenter_driver/virtual_machine.rb:239:inimport_vcenter_disks’”, “/usr/lib/one/sunstone/routes/vcenter.rb:338:in block in '", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1611:incall’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1611:in block in compile!'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in[]’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in block (3 levels) in route!'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:994:inroute_eval’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:975:in block (2 levels) in route!'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1015:inblock in process_route’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1013:in catch'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1013:inprocess_route’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:973:in block in route!'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:972:ineach’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:972:in route!'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1085:inblock in dispatch!’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in block in invoke'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:incatch’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in invoke'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1082:indispatch!’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in block in call!'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:inblock in invoke’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:in catch'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1067:ininvoke’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:907:in call!'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:895:incall’”, “/usr/local/share/gems/gems/rack-1.6.4/lib/rack/commonlogger.rb:33:in call'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:219:incall’”, “/usr/local/share/gems/gems/rack-1.6.4/lib/rack/deflater.rb:35:in call'", "/usr/local/share/gems/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:incontext’”, “/usr/local/share/gems/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in call'", "/usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:incall’”, “/usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in call'", "/usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:incall’”, “/usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in call'", "/usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:incall’”, “/usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in call'", "/usr/local/share/gems/gems/rack-1.6.4/lib/rack/nulllogger.rb:9:incall’”, “/usr/local/share/gems/gems/rack-1.6.4/lib/rack/head.rb:13:in call'", "/usr/local/share/gems/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:incall’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:182:in call'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:2013:incall’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1487:in block in call'", "/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1787:insynchronize’”, “/usr/local/share/gems/gems/sinatra-1.4.7/lib/sinatra/base.rb:1487:in call'", "/usr/local/share/gems/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb:97:inprocess_request’”, “/usr/local/share/gems/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:152:in accept_and_process_next_request'", "/usr/local/share/gems/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb:113:inmain_loop’”, “/usr/local/share/gems/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/request_handler.rb:416:in block (3 levels) in start_threads'", "/usr/local/share/gems/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/utils.rb:113:inblock in create_thread_and_abort_on_exception’”]

Thanks !

I am seeing the same thing here… started a new thread/issue last night.

has anyone found a workaround for this?

No workaround for me

Could you replace the /usr/lib/one/ruby/vcenter_driver/virtual_machine.rb with the following file:

https://github.com/OpenNebula/one/blob/master/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb

and let us know if it works, or what error messages it produces

Thanks Tino,

i could test next week.

I will keep you posted

I’ll see if I can test this this week/weekend.