VMware Cloud Community
Newbie407
Contributor
Contributor

Copy Files from NFS datatsore to local datatsore using VMWARE API

Hi Experts,

Need to get some help here>

As part of our new requirements, we are mounting our linux machine as NFS datastore  on ESXi host. Later on it is needed to move some of the files from the NFS datastore to local datastore by creating a new folder in local datastore.

Can you please let us know whether it is possible to do and how to do ?

Thanks in Advance

Best Regards

Reply
0 Kudos
2 Replies
vThinkBeyondVM
VMware Employee
VMware Employee

Hi Friend,

As we discussed in other discussion, creating NFS datastore using API (using vCenter session ) was successful and it is added on sample exchange: Create NFS Datastore using vSphere API - Samples - VMware Developer Center

I have decided to try to create the same using ESXi server session. I will get back as soon as possible. please stay tuned.

Nonetheless,

You can request any API sample/requirement now on VMware sample exchange here: All Samples - Samples - VMware Developer Center   It is one point shop for any  API related activity across any product, any SDK


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

Reply
0 Kudos
vThinkBeyondVM
VMware Employee
VMware Employee

I have modified earlier pointed “CreateNFSDatastore” class to work for both VC and ESXi. And also I have written another class “AddNFSDatastoreinESXi” which will work only for ESXi to add the NFS datastore. Please take a look.

CreateNFSDatastore.java à Now it works for both VC/ESXi to add NFS datastore ,

       Usage: CreateNFSDatastore url username password hostip/fqdn

       Note:: In ESXi case both url & hostip/fqdn ip should be same.

AddNFSDatastoreinESXi.java à It works only for ESXi to add NFS datastore.

     Usage: AddNFSDatastoreinESXi hostname username password

Let us know if you need more help.


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

Reply
0 Kudos