public ManagedObjectReference createNfsDatastore(String host, int port, String exportPath, String uuid) throws Exception { HostNasVolumeSpec spec = new HostNasVolumeSpec(); spec.setRemoteHost(host); spec.setRemotePath(exportPath); spec.setType("nfs"); spec.setLocalPath(uuid); // readOnly/readWrite spec.setAccessMode("readWrite"); return _context.getService().createNasDatastore(_mor, spec); }