I tried to used the copyDatastoreFile_Task() method and while it seems to be working, it's creating a small (less than 1KB) file on the destination datastore instead of a vmdk that is full size. Anyone seen this before and know the cause?
Related to this, if a disk is thin, lazy zeroed or eager zeroed, does the format remain the same after the copy ? (assuming I can get the copy to work)
Looks like I partially solved my own problem. I was using the wrong method. To copy a disk it should be copyVirtualDisk_Task()
There's a comment on the VcVirtualDiskManager saying most of the APIs will be deprecated and to use VStorageObjectManager instead. Anyone have a sample code to share on this new API? I'm not even sure how to get the ID it wants.
From what I have read this new API is for managing first class disks.... would that apply a normal disk that is attached to a vm?
Hi,
what version are you using it on?
https://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.FileManager.html
CopyDatastoreFile_Task
Faults
Type | Description |
---|---|
CannotAccessFile | Thrown if the source cannot be accessed because of insufficient permissions. |
FileAlreadyExists | Thrown if a file with the given name already exists at the destination, and the force flag is false. |
FileFault | |
FileLocked | Thrown if the source file is currently locked or in use. |
FileNotFound | Thrown if the file specified by sourceName is not found, or, any intermediate level folder specified by the destinationName is not found. |
InvalidDatastore | Thrown if the operation cannot be performed on the source or destination datastores. Typically, a specific subclass of this exception is thrown. |
NoDiskSpace | Thrown if there is not enough space available at the destination datastore. |
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error. |
can you post the 1kb file? inside there may be information that helps to understand.
ARomeo
Hi,
it seems to be fine also for the vm.
Interface to manage virtual storage object on a vCenter. VStorageObjectManager and SPBM policy support: All of the VStorageObjectManager APIs requiring ESXi host uses "Programatically selected" host to perform the actual operation. If the selected host is of 6.5 version then policy would not be passed down to host. In that case, user operation would succeed but if user checks SPBM Entity Compliance, it will show "Mismatch" / "Non Compliant" as a compliance result.
ARomeo