vmware/pyvmomi-community-samples

How to copy all vmdk files to a new folder

開放

#495 建立於 2018年6月14日

 (2 則留言) (0 個反應) (0 位負責人)Python (914 個分叉)batch import
help wanted

倉庫指標

星標
 (972 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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)

貢獻者指南