# vmware\_guest\_snapshot module unable to find VM with Ansible 2.4.2

**URL:** <https://forum.ansible.com/t/vmware-guest-snapshot-module-unable-to-find-vm-with-ansible-2-4-2/26603>\
**Category:** Ansible Project\
**Created:** [January 30, 2018, 3:46pm UTC](https://forum.ansible.com/t/vmware-guest-snapshot-module-unable-to-find-vm-with-ansible-2-4-2/26603 "2018-01-30T15:46:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Hunt](https://avatars.discourse-cdn.com/v4/letter/p/c68b51/32.png) [@Patrick\_Hunt](https://forum.ansible.com/u/Patrick_Hunt)\
**Post date:** [January 30, 2018, 3:46pm UTC](https://forum.ansible.com/t/vmware-guest-snapshot-module-unable-to-find-vm-with-ansible-2-4-2/26603/1 "2018-01-30T15:46:14Z")

</div>

I have recently updated to Ansible 2.4.2

I have plays that will remove old snapshots from specific VMs and will create new snapshots for those VMs.

The remove playbook is as follows:

`

---

<div class="post-metadata">

**Author:** ![Patrick\_Hunt](https://avatars.discourse-cdn.com/v4/letter/p/c68b51/32.png) [@Patrick\_Hunt](https://forum.ansible.com/u/Patrick_Hunt)\
**Post date:** [January 31, 2018, 3:07pm UTC](https://forum.ansible.com/t/vmware-guest-snapshot-module-unable-to-find-vm-with-ansible-2-4-2/26603/2 "2018-01-31T15:07:40Z")

</div>

I was able to use another module to solve this issue. I setup a play using the module [vmware\_guest\_find](http://docs.ansible.com/ansible/latest/vmware_guest_find_module.html).

The play I used is:

`

- hosts: localhost  
vars\_prompt:

- name: username  
prompt: “VCenter username”  
private: no

- name: password  
prompt: “VCenter password”  
private: yes

tasks:

- name: find vm paths  
vmware\_guest\_find:  
hostname: vcenter.host  
datacenter: QAE  
name: “{{ item }}”  
password: “{{ password }}”  
username: “{{ username }}”  
validate\_certs: false  
register: path  
deligate\_to: localhost  
with\_items:
- vm1.domain
- vm2.domain
- vm3.domain
- vm4.domain  
…  
`

The output (with the verbosity increased -vv) is:  
ok: [localhost] =\> (item=vm1.domain) =\> {“changed”: false, “folders”: [“/vm/Staging”], “item”: “vm1.domain”}

So this gave me the path of /vm/Staging. Per the module documentation for [vmware\_guest\_snapshot](http://docs.ansible.com/ansible/latest/vmware_guest_snapshot_module.html) it is stated that the datacenter should also be included in the folder. So the value for folder, in my example, is “QAE/vm/Staging” and now my snapshot playbooks work.

I hope this is able to help someone else.
