Reply to Message

View discussion in a popup

Replying to:
va_dmiranda
Contributor
Contributor

Ansible Get VMs per datastore

Hello,
Is it possible to return with an ansible module from the vmware.vmware_rest collection a list of VMs per datastore.
I'm trying to obtain the same result as the following powershell command: "Get-VM -Datastore datastore-name", but with Ansible.
How can I achieve that?

In the final, I want a dict with the vm name and the datastore:
vm1;datastoreA
vm2;datastoreA
vm3;datastoreB
vm4;datastoreC
...

Tanks for your help.

Reply
0 Kudos