VMware {code} Community

Copy VM Folder back to original datastore


I have a datastore which is under line connected to NetApp Filer.I have taken hardware level snapshot for that volume.

Now this hardware level snap I have mounted on the same esx server thorugh some APIs and created the mounted datastore.

Now I want to copy one VM folder from this mounted datastore to orginial datastore i,e I want to perform restore of a virtual machine through API.

Which is best way to achieve this through API?

  • CopydatastoreFile_Task() (Whether this will copy whole VM folder?)

  • Or should I use HTTP APIs?

  • Any other best alternative?


0 Kudos
1 Reply

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.



0 Kudos