It worked for me when I invoked this API against vCenter. Below is the code snippet
HostDatastoreSystem dssystem=host.getHostDatastoreSystem();
HostNasVolumeSpec NasSpec=new HostNasVolumeSpec();
NasSpec.setAccessMode("readWrite");
NasSpec.setLocalPath("NFSShare2");
NasSpec.setRemoteHost("10.192.x.x"); //NFS server IP
NasSpec.setRemotePath("/store1");
dssystem.createNasDatastore(NasSpec);
System.out.println("createNasDatastore API is called");
Can you please try the same? At the moment, I am not sure if this API works directly on ESXi host as well (Without any connection to vCenter)
I am using VC 60U2 and ESXi also 60U2.
Let me know your progress.