Get VM Template Return Nothingl when importing Template

I tried the latest OpenNebula 5.4. When importing VM template from vCenter by Sunstone GUI, it returned nothing. But by CLI onevcenter, I can import those template in vCenter.

Hi Jeff,
thanks for your feedback (and of course Anton’s feedback).

That’s a recently detected issue in the 5.4 beta. The template import process is somehow quite heavy as it has to discover the disks and nics that in the past were not visible. In Sunstone, there’s a 30 seconds timeout that may break the import it the operation takes more than that time to finish. That timeout is not used in the CLI, hence the CLI can finish the import process. This issue has been detected and fixed.


Hi Mcavrerizo,

Sorry for I make you get misunderstood my problem about the template. I detail the problem more.

The problem is that after I filled in vCenter IP, username and password and pressed “Get VM Template”, it showed processing a while and finished. But under “template”, there were no templates to be found. In addition, I have imported the datastores those templates are located at before doing template import.

Furthermore, I returned to the previous version 5.2.1 to try once, it was OK. After pressing “Get VM Template”, all templates in the vCenter can be found and were shown under “Template”

Regards /Jeff Wong

Hi Jeff!,
thanks a lot for your feedback it’s really helpful.

Then you have an issue getting the list of templates to be imported from Sunstone, but you can get the list using the onevcenter tool, right? I’ve been thinking what could cause that CLI shows templates while Sunstone doesn’t show a single template in beta:

  • Could you check if you’re importing templates from clusters where vSphere DRS is disabled or where resource pools are not used?

To confirm that issue or a different one, if you’re using Firefox or Chrome can you open the Developer Tools pressing Ctrl + Shift + I and once the development section is added to your browser at the bottom, could you try to click on the Get VM Templates button?

In Firefox do you see a message like this in the Developer Tools Console tab?

In Chrome do you see a message like this in the Developer Tools Console tab?

If you get different errors could you paste them with its details so we can check what is happening in the Javascript? Maybe Sunstone is not parsing correctly the templates list.

Once again I’d like to thank you for your time and feedback, it helps us to find undetected bugs.



Yes, I can import templates from vCenter by onevcenter CLI as following

[root@opennebula538 ~]# onevcenter templates --vcenter --vuser oneadmin --vpass P@ssw0rd

Connecting to vCenter:…done!

Looking for VM Templates…done!

Do you want to process datacenter yecvcent01-datacenter (y/[n])? y

  • VM Template found:
    • Name : [ - yecvcent01-datacenter] one-Rh73 - yecvcent01-clusterdev
    • Moref : vm-49653
    • Cluster: yecvcent01-clusterdev

In Firefox, I got the message below when pressing “Get VM Template”

TypeError: opts.resourcePool is undefined[Learn More] main.js:103628:15

In Chrome console, it shows below

main.js:103628 Uncaught TypeError: Cannot read property ‘params’ of undefined
at Object. (main.js:103628)
at Function.each (main.js:798)
at Array. (main.js:103620)
at Function.each (main.js:804)
at Object.success (main.js:103595)
at fire (main.js:3620)
at Object.fireWith [as resolveWith] (main.js:3750)
at done (main.js:9218)
at XMLHttpRequest. (main.js:9584)

Regards /Jeff Wong

Hi Jeff!
thank you once more for your feedback.

Then you’ve confirmed that it’s a Javascript bug in Sunstone when dealing with templates that reside in vCenter clusters that have no resource pools (DRS is disabled). There’s a fix for that issue in master and I’ll try to prepare a patch for this beta, in that case I’ll post here the link to the file.

Please don’t hesitate to communicate any other issue or doubt you found, your help is much appreciated.