Software Development Kit (SDK) and API Discussions

Beginning SDK Question


I have just started trying to use the NMSDK5.2.1R1 to automate some tasks on a NetApp8020 that's running DataONTAP8.2.1.  I am trying to some basic things like add a volume to an existing vserver.  Eventually I will automate the failover from one cluster to another using the API.

I have run into a slight problem, which may be due to the fact that I new to both the NetApps and the API.  When I attempt to execute the 'volume-create' API function against the vserver I get the following return: reason="Authorization failed" errno="13002".  If I understand the API correctly, I have to execute the 'volume-create' against the vserver context since that API function does not appear to be available at the Cluster level.

If I try to execute the volume create manually by logging into the mgmt interface for the vserver, I cannot as I the aggregate required to configure the volume is not visible.  I can log into to the cluster mgmt interface and configure the vol for the vserver with no problem.  However, the API does not have the 'volume-create' function to execute against the cluster mgmt.

Am I missing something simple?  Such as simply changing the configuration so that you can access aggrs from within the vserver context?  Or is this a problem with the API?

I apologize up front if this has been addressed somewhere, but if it has I have not found it.  I will continue to search for a reference that answers this already in the mean.




Re: Beginning SDK Question


Hi Todd,

You need to either assign the aggregate to the vserver to run the command in vserver context, or run the command from the cluster management interface and tunnel it the desired vserver.

If you want to assign the aggregate to the vserver, which will give the vserver admin access to that aggregate, use this command:

cluster01::> vserver modify -vserver vs1 -aggr-list aggr1,aggr2,...

Before running the command, make sure to note the aggregates already assigned to the vserver and add them to the command so you don't accidentally remove assigned aggregates.

cluster01::> vserver show -vserver vs1 -fields aggr-list

If you'd rather do it using vserver tunneling on the cluster management interface, see the command named something similar to set_vserver() in the language you're using.

Hope that helps. Let us know if you run into any more issues.


Re: Beginning SDK Question


That did help but didn't quite get me there.  After making the change I was able to configure a volume from within the vserver context by logging in directly to the vserver.  But I still can't do it via the API.  Get the authorization failed error using the same credentials that I use to login via ssh.

It leads me to believe that I have misconfigured something that allows access to the vserver via API.  I have also tried using vserver tunneling but the tunnel attempt fails when executing the vserver_set() function from the session.

Thanks for the help.  It has at least gotten me to the point where I narrowed down the ultimate problem.

Re: Beginning SDK Question


Ah, sorry, I misunderstood where your error was coming from. You likely need to grant ontapi access to your user.

cluster01::> security login create -username myuser -vserver vs1 -authmethod password -application ontapi

See if that gets it going.


View solution in original post

Re: Beginning SDK Question


That's the ticket.  Thanks very much.  I now know where to look for other stuff that I missed and will add this to my standard vserver setup.

So I did actually have two problems, both of which are now resolved.

2021 NetApp Partner Experience Survey
PES Banner
All Community Forums