# VM template with user\_inputs instanstiated automatically (without 'human' intervention)

**URL:** <https://forum.opennebula.io/t/vm-template-with-user-inputs-instanstiated-automatically-without-human-intervention/4321>\
**Category:** Product Support\
**Created:** [May 22, 2017, 4:48pm UTC](https://forum.opennebula.io/t/vm-template-with-user-inputs-instanstiated-automatically-without-human-intervention/4321 "2017-05-22T16:48:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![apoz](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@apoz](https://forum.opennebula.io/u/apoz)\
**Post date:** [May 22, 2017, 4:48pm UTC](https://forum.opennebula.io/t/vm-template-with-user-inputs-instanstiated-automatically-without-human-intervention/4321/1 "2017-05-22T16:48:08Z")

</div>

Hi,

just wondering if there is any option I’m missing.  
I’ve got some VM template with some user\_input defined fields.

I’d like to instantiate the a VM of that template with the CLI client BUT ‘automatically’, this is, not providing the values with ‘human interaction’ but with the values in some key-value file.

I had a look at the onetemplate CLI command source code, and I think if the template has user\_inputs, the launch of the helper to ‘interact with the human’ to get the values is launched mandatory.

Is there any way to provide the user\_input field values in a file for the onetemplate CLI?  
It can’t be done even defining a Oneflow service for the template ,right?  
(we can do it with Oneflow API, but it would be better for us to be able to achieve it with the CLI (we want to do it from ansible))

Thanks in advance!

Regards,  
Andrés

---

<div class="post-metadata">

**Author:** ![juanmont](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@juanmont](https://forum.opennebula.io/u/juanmont)\
**Post date:** [June 13, 2017, 9:08am UTC](https://forum.opennebula.io/t/vm-template-with-user-inputs-instanstiated-automatically-without-human-intervention/4321/2 "2017-06-13T09:08:06Z")

</div>

You can use the redirect of linux.

Something like this:  
’ onetemplate instantiate “ID” \< input\_file.in ’

Regards!

---

<div class="post-metadata">

**Author:** ![gbernardes](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@gbernardes](https://forum.opennebula.io/u/gbernardes)\
**Post date:** [March 12, 2019, 11:36am UTC](https://forum.opennebula.io/t/vm-template-with-user-inputs-instanstiated-automatically-without-human-intervention/4321/3 "2019-03-12T11:36:30Z")

</div>

Hi @juanmont , Can you give-me example of the content of file “input\_file.in”?

In my case, the template requires (in order): CPU, Memory and Password. In the input file I put:

1  
1024  
MyExamplePassWord@

But when execute this, happens this error:

$ onetemplate instantiate 57 \< /tmp/input\_file.in  
…  
Press enter for default (1). Please type the selection number: \* (MEMORY)  
Press enter for default (1024). Integer in the range [1024…131072]: \* (PASSWORD) ROOT PASSWORD  
Password: /usr/lib/one/ruby/cli/one\_helper.rb:467:in `noecho': Inappropriate ioctl for device (Errno::ENOTTY) from /usr/lib/one/ruby/cli/one_helper.rb:467:in`get\_password’  
from /usr/lib/one/ruby/cli/one\_helper/onetemplate\_helper.rb:189:in `block in get_user_inputs' from /usr/lib/one/ruby/cli/one_helper/onetemplate_helper.rb:140:in`each’  
from /usr/lib/one/ruby/cli/one\_helper/onetemplate\_helper.rb:140:in `get_user_inputs' from /bin/onetemplate:255:in`block (4 levels) in ’  
from /usr/lib/one/ruby/cli/one\_helper.rb:779:in `call' from /usr/lib/one/ruby/cli/one_helper.rb:779:in`perform\_action’  
from /bin/onetemplate:227:in `block (3 levels) in <main>' from /bin/onetemplate:226:in`times’  
from /bin/onetemplate:226:in `block (2 levels) in <main>' from /usr/lib/one/ruby/cli/command_parser.rb:470:in`call’  
from /usr/lib/one/ruby/cli/command\_parser.rb:470:in `run' from /usr/lib/one/ruby/cli/command_parser.rb:84:in`initialize’  
from /bin/onetemplate:34:in `new' from /bin/onetemplate:34:in`’

---

<div class="post-metadata">

**Author:** ![gbernardes](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@gbernardes](https://forum.opennebula.io/u/gbernardes)\
**Post date:** [March 15, 2019, 12:53pm UTC](https://forum.opennebula.io/t/vm-template-with-user-inputs-instanstiated-automatically-without-human-intervention/4321/4 "2019-03-15T12:53:32Z")

</div>

Anyone help-me?

---

<div class="post-metadata">

**Author:** ![gbernardes](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@gbernardes](https://forum.opennebula.io/u/gbernardes)\
**Post date:** [March 21, 2019, 6:39pm UTC](https://forum.opennebula.io/t/vm-template-with-user-inputs-instanstiated-automatically-without-human-intervention/4321/5 "2019-03-21T18:39:31Z")

</div>

I solved this problem using Python and paramiko. I writed a script that connect ssh in localhost and enter user inputs of “one template instantiate” as a human.
