Quantcast
Channel: VMware Communities : Popular Discussions - VIX API
Viewing all articles
Browse latest Browse all 34639

CopyDatastoreFile_Task strange behaviour

$
0
0

 

Hello,

 

 

I need to copy virtual disks (or files) between datastors in VI. I am using VMware Infrastructure (VI) API from perl. Initialy I tried to use CopyVirtualDisk_Task, but it apeared that it works just with ESX servers not virtual center. Then I tried to use  CopyDatastoreFile_Task. CopyDatastoreFile_Task works fine with copying files in general, but it has strange behaviour when VM disk files ".vmdk" should be copied. When copying vmdk files it just creates very smallfile in destination - I think that it is some kind of reference to original file. Why it is so?

 

 

Following code is used in perl script to do the copy.

 

 

my $service_content = Vim::get_service_content();

my $file_mgr = Vim::get_view(mo_ref => $service_content->fileManager);

$file_mgr->waitForTask($file_mgr->CopyDatastoreFile_Task(sourceName => $SourceName,sourceDatacenter => $SourceDatacenter,destinationName => $DestName,destinationDatacenter => $DestDatacenter));

 

 

 

I also tried to move the file using MoveDatastoreFile_Task - it renamed source file dummy.vmdk to dummy-flat.vmdk, but in destination it again created very small file dummy.vmdk. But after that I was able to copy dummy-flat.vmdk with CopyDatastoreFile_Task. Can somebody explain this strange behaviour? Is there something wrong in those perl lines above? Files with extentions vmx, vmsd, vmxf I was able to copy successfuly.

 

 

Regards,

 

 

Roberts

 

 


Viewing all articles
Browse latest Browse all 34639

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>