# Getting error in deploying VMs using Ansible vsphere\_guest module

**URL:** <https://forum.ansible.com/t/getting-error-in-deploying-vms-using-ansible-vsphere-guest-module/17507>\
**Category:** Ansible Project\
**Created:** [February 12, 2015, 11:56am UTC](https://forum.ansible.com/t/getting-error-in-deploying-vms-using-ansible-vsphere-guest-module/17507 "2015-02-12T11:56:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnitin80](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jnitin80](https://forum.ansible.com/u/jnitin80)\
**Post date:** [February 12, 2015, 11:56am UTC](https://forum.ansible.com/t/getting-error-in-deploying-vms-using-ansible-vsphere-guest-module/17507/1 "2015-02-12T11:56:43Z")

</div>

I am getting below error while using Ansible (version 1.8.2) vSphere\_guest module,

osboxes@osboxes:~$ ansible-playbook /etc/ansible/playbooks/main.yml -K  
sudo password:

PLAY [localhost] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK: [vsphere\_guest] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
failed: [localhost] =\> {“failed”: true, “parsed”: false}  
SUDO-SUCCESS-ldmjglnajxpocoybboumisekhbbnmhnp  
Traceback (most recent call last):  
File “/home/osboxes/.ansible/tmp/ansible-tmp-1423728228.54-220175308723408/vsphere\_guest”, line 2791, in   
main()  
File “/home/osboxes/.ansible/tmp/ansible-tmp-1423728228.54-220175308723408/vsphere\_guest”, line 1197, in main  
config\_check(“vm\_disk”, vm\_disk, proto\_vm\_disk, module)  
File “/home/osboxes/.ansible/tmp/ansible-tmp-1423728228.54-220175308723408/vsphere\_guest”, line 1012, in config\_check  
if diff.recursive\_diff():  
File “/home/osboxes/.ansible/tmp/ansible-tmp-1423728228.54-220175308723408/vsphere\_guest”, line 983, in recursive\_diff  
if k in self.check\_dict[key]:  
TypeError: argument of type ‘NoneType’ is not iterable

FATAL: all hosts have already failed – aborting

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
to retry, use: --limit @/home/osboxes/main.retry

localhost : ok=0 changed=0 unreachable=0 failed=1

Did anybody face this issue before? It may be, I am doing some silly mistake but unable to catch that.

Thanks

---

<div class="post-metadata">

**Author:** ![Daniel6](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@Daniel6](https://forum.ansible.com/u/Daniel6)\
**Post date:** [February 12, 2015, 10:45pm UTC](https://forum.ansible.com/t/getting-error-in-deploying-vms-using-ansible-vsphere-guest-module/17507/2 "2015-02-12T22:45:27Z")

</div>

Can you post the vsphere\_guest task that’s failing? I can’t pick it exactly from that error but we use it a fair bit so can at least have a gander for any of the things we tripped up on while figuring it out.

Cheers,  
Daniel

---

<div class="post-metadata">

**Author:** ![Giovanni\_Tirloni](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Giovanni\_Tirloni](https://forum.ansible.com/u/Giovanni_Tirloni)\
**Post date:** [February 13, 2015, 1:26am UTC](https://forum.ansible.com/t/getting-error-in-deploying-vms-using-ansible-vsphere-guest-module/17507/3 "2015-02-13T01:26:09Z")

</div>

Please share the task definition (without confidential data).

Giovanni

---

<div class="post-metadata">

**Author:** ![jnitin80](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jnitin80](https://forum.ansible.com/u/jnitin80)\
**Post date:** [February 13, 2015, 9:50am UTC](https://forum.ansible.com/t/getting-error-in-deploying-vms-using-ansible-vsphere-guest-module/17507/4 "2015-02-13T09:50:27Z")

</div>

Hi,

Below is yml am using,

---

<div class="post-metadata">

**Author:** ![Giovanni\_Tirloni](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Giovanni\_Tirloni](https://forum.ansible.com/u/Giovanni_Tirloni)\
**Post date:** [February 13, 2015, 10:11am UTC](https://forum.ansible.com/t/getting-error-in-deploying-vms-using-ansible-vsphere-guest-module/17507/5 "2015-02-13T10:11:35Z")

</div>

I think you need to fix the indentation:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vm\_disk:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;disk1:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size\_gb: 1  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type: thin  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;datastore: compute

[http://yaml.org/spec/current.html#id2519916](http://yaml.org/spec/current.html#id2519916)

Giovanni

---

<div class="post-metadata">

**Author:** ![Mark\_Phillips](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mark\_Phillips](https://forum.ansible.com/u/Mark_Phillips)\
**Post date:** [February 14, 2015, 10:25am UTC](https://forum.ansible.com/t/getting-error-in-deploying-vms-using-ansible-vsphere-guest-module/17507/6 "2015-02-14T10:25:27Z")

</div>

You might be getting bitten by something I fixed in December…

[https://github.com/ansible/ansible-modules-core/pull/562](https://github.com/ansible/ansible-modules-core/pull/562)

Does it do the same if you use the devel branch?

---

<div class="post-metadata">

**Author:** ![jnitin80](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jnitin80](https://forum.ansible.com/u/jnitin80)\
**Post date:** [February 15, 2015, 6:02am UTC](https://forum.ansible.com/t/getting-error-in-deploying-vms-using-ansible-vsphere-guest-module/17507/7 "2015-02-15T06:02:54Z")

</div>

Thank you Giovanni!! That solved the problem.

-Nitin

---

<div class="post-metadata">

**Author:** ![jnitin80](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jnitin80](https://forum.ansible.com/u/jnitin80)\
**Post date:** [February 15, 2015, 6:06am UTC](https://forum.ansible.com/t/getting-error-in-deploying-vms-using-ansible-vsphere-guest-module/17507/8 "2015-02-15T06:06:00Z")

</div>

Thanks Mark, Daniel. That was the yml issue.
