Copying files from vsphere datastore to host

332 views
Skip to first unread message

spongebob33167

unread,
May 3, 2019, 8:25:52 AM5/3/19
to Ansible Project
With vsphere_copy, I can upload files to a vsphere datastore, but I want to download a .vmdk file from a datastore to my local server.  Is there an ansible module that will let me download from a datastore?

Gonéri Le Bouder

unread,
May 3, 2019, 11:14:21 AM5/3/19
to spongebob33167, Ansible Project
Hi Spongebob33167!

You can already browse the /folder end-point with a browser and so use
the get_url module:

e.g: https://192.168.1.40/folder on my ESXi returns a listing of the
datacenter. And I can navigate to finally download a file.

The API documentation:
https://pubs.vmware.com/vsphere-6-5/index.jsp?topic=%2Fcom.vmware.vcli.examples.doc%2FGUID-7675E084-5A80-4517-83B7-6BBC69F8D145.html

Regards,
--
Gonéri Le Bouder

spongebob33167

unread,
May 3, 2019, 2:54:24 PM5/3/19
to Ansible Project
Thank you!  get_url works.  The tricky part was figuring out the url to the file I wanted.

On Friday, May 3, 2019 at 11:14:21 AM UTC-4, Gonéri Le Bouder wrote:
Reply all
Reply to author
Forward
0 new messages