vmware_guest_snapshot module unable to find VM with Ansible 2.4.2

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:

`

I was able to use another module to solve this issue. I setup a play using the module vmware_guest_find.

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 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.