Smiddy
Contributor
Contributor

How do I create a NFS datastore using a workflow?

Hello,

I need to create a number of NFS datastore connections, so I tried to build an Orchestrator workflow to handle this.

Up to now, I created a workflow containing a scriptable task:

-


var datastore_mgr = Host.configManager.datastoreSystem;

var new_spec = new VcHostNasVolumeSpec();

new_spec.accessMode=VcHostMountMode._readWrite;

new_spec.localPath=DatastoreName;

new_spec.remoteHost=remoteHost;

new_spec.remotePath=remotePath;

new_spec.type="nfs";

try {

var newDatastore=datastore_mgr.createNasDatastore(new_spec);

}

catch (ex){

System.error(ex" creating datastore "remoteHost":"remotePath" on "Host.name" as datastore "DatastoreName);

}

-


I used this workflow on a host with known NFS connectivity and with a known existing NFS path. However, all I get is this error message:

InternalError: An error occurred during host configuration. (Workflow:CreateNfsDatastore / Scriptable task (item0)#9) creating datastore nfs_server:/vol/existing_export_path on this_host as datastore hugo

Did I miss something? How can I debug deeper into this "error during host configuration"?

Any help will be appreciated.

0 Kudos
1 Reply
Smiddy
Contributor
Contributor

Sorry.

I just noticed that I had a typo in the NFS export path. Using the correct export path made it work.

However, I had to dig down into the vmkernel log of the server to learn that the primary error was a "permission denied" from my NFS server.

I would really prefer a more specific error message (exception text) here Smiley Sad

0 Kudos