Hi Ashwin,
If you refer to the API description of CopyDatastoreFile_Task, it is specified as an experimental API. Refer to the following description:
"It is important to note that this operation will provide transactional guarantees only for a file. No guarantees are provided when copying a folder. If the intent is to clone a virtual machine registered in the inventory, with transactional guarantees, please refer to .
Datastore.FileManagement privilege is required on both source and destination datastores.
Experimental. Subject to change "
VMware advises not to use the experimental APIs in the production environment, but you can use them in your testing environment.
So you can go for HTTP access APIs to tranfer or copy the virtual machine folder. This approach can be slow in cases where you are copying a heavy file/folder.
Thanks.
Angela