# deploying template with vsphere\_guest failing

**URL:** <https://forum.ansible.com/t/deploying-template-with-vsphere-guest-failing/21710>\
**Category:** Ansible Project\
**Created:** [June 9, 2016, 12:51am UTC](https://forum.ansible.com/t/deploying-template-with-vsphere-guest-failing/21710 "2016-06-09T00:51:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Richards](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@Jeff\_Richards](https://forum.ansible.com/u/Jeff_Richards)\
**Post date:** [June 9, 2016, 12:51am UTC](https://forum.ansible.com/t/deploying-template-with-vsphere-guest-failing/21710/1 "2016-06-09T00:51:15Z")

</div>

When trying to deploy a template (Ansible 1.9.6) as follows:

- hosts: 127.0.0.1  
connection: local  
user: root  
sudo: false  
gather\_facts: false  
serial: 1

tasks:

- vsphere\_guest:  
vcenter\_hostname: XXXXXXXXX  
username: XXXXXXXXXX  
password: ‘XXXXXX’  
guest: testvm  
from\_template: yes  
template\_src: XXXXXXXXXXX  
esxi:  
datacenter: XXXXX  
hostname: XXXXXXx

I get the error:  
msg: parameters are required together: [‘from\_template’, ‘resource\_pool’, ‘template\_src’]

Now this is well documented and was addressed some time back:  
[https://github.com/rce/ansible-modules-core/commit/1a8da60253ddeb761110102f2b4421ffdc36c401](https://github.com/rce/ansible-modules-core/commit/1a8da60253ddeb761110102f2b4421ffdc36c401)

“vsphere\_guest now can deploy a template using a datacenter and hostname as the target, instead of requiring a cluster and resource\_pool.”

Any idea why I appear to be seeing a regression here?

Jeff

---

<div class="post-metadata">

**Author:** ![Ayan\_Dasgupta](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@Ayan\_Dasgupta](https://forum.ansible.com/u/Ayan_Dasgupta)\
**Post date:** [June 9, 2016, 9:46am UTC](https://forum.ansible.com/t/deploying-template-with-vsphere-guest-failing/21710/2 "2016-06-09T09:46:58Z")

</div>

Can you try adding a dummy resource pool in your code if you don’t have any in our environment ?

Example :–

resource\_pool: “/Resources”

---

<div class="post-metadata">

**Author:** ![Jeff\_Richards](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@Jeff\_Richards](https://forum.ansible.com/u/Jeff_Richards)\
**Post date:** [June 9, 2016, 7:11pm UTC](https://forum.ansible.com/t/deploying-template-with-vsphere-guest-failing/21710/3 "2016-06-09T19:11:52Z")

</div>

Yes, already tried that, it just errors saying I also need to specify a cluster - and there’s no dummy resource for that.

It’s exactly what was described (and fixed(?)) here:

[https://github.com/rce/ansible-modules-core/commit/1a8da60253ddeb761110102f2b4421ffdc36c401](https://github.com/rce/ansible-modules-core/commit/1a8da60253ddeb761110102f2b4421ffdc36c401)

“vsphere\_guest now can deploy a template using a datacenter and hostname as the target, instead of requiring a cluster and resource\_pool.”

Jeff

---

<div class="post-metadata">

**Author:** ![Jeff\_Richards](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@Jeff\_Richards](https://forum.ansible.com/u/Jeff_Richards)\
**Post date:** [June 9, 2016, 7:27pm UTC](https://forum.ansible.com/t/deploying-template-with-vsphere-guest-failing/21710/4 "2016-06-09T19:27:26Z")

</div>

Ok, end of puzzle; this works fine in Ansible 2.x

Jeff
