pyvmomi-community-samples icon indicating copy to clipboard operation
pyvmomi-community-samples copied to clipboard

How to list all file in specific folder in datastore and download it?

Open SarindraTherese opened this issue 2 years ago • 0 comments

Describe the bug

I want to recover the screenshots of a specified vm then delete them or group them in another directory in the vcenter browser via pyvmomi.

Reproduction steps

the step i've tried: Step 1- Download from Datastore https://github.com/vmware/pyvmomi/issues/814 this not work for me the error:

  File "C:\Users\Desktop\myproj\venv\Lib\site-packages\requests\adapters.py", line 523, in send
    for i in request.body:
  io.UnsupportedOperation: read

Step 2- How to list all folder in every datastore https://github.com/vmware/pyvmomi-community-samples/issues/343 This work, but now i want access the folder But I don't have any tips to do this

Expected behavior

This is my list of folder in datastore

  • [VM]/VM-Screenshot
  • [VM]/VM-Template

I want to download all image in [VM]/VM-Screenshot like VM-Screenshot-1.png, VM-Screenshot-2.png, ... After create a new folder [VM]/VM-Screenshot entitled Downloaded where I will then move the images that I have already uploaded.

Additional context

No response

SarindraTherese avatar May 08 '23 14:05 SarindraTherese