vmware / pyvmomi-community-samples

A place for community contributed samples for the pyVmomi library.
Apache License 2.0
1.01k stars 922 forks source link

How to copy all vmdk files to a new folder #495

Open s1dsaharan opened 6 years ago

s1dsaharan commented 6 years ago

When a snapshot is created a new .vmdk file is made in the folder of the VM (with respect to filesystem). How can I copy all the .vmdk (i.e. vm.vmdk , vm-000001.vmdk , and so on) to a new folder. PS- I have tried looping the serviceContent.virtualDiskManager.CopyVirtualDisk_Task for different vmdk files but it copies the same file(vm.vmdk) over and over again (I saw that from the size of file being copied) PPS- I have also tried content.fileManager.CopyDatastoreFile_Task but it does not even copy vm.vmdk properly (The size of file is 1 gb but it stops copying at 0.59 kb itself)

DBS12 commented 5 years ago

Hi, have you find any solution? Can you attach the example for:

serviceContent.virtualDiskManager.CopyVirtualDisk_Task

@s1dsaharan

isarantis commented 4 years ago

any solutions to this? aparently the datacenter property should be set on the invokation of CopyVirtualDisk_Task and MovieFile. Also we had the same issue if the vmdk was in use ( you could not move it)