Python Discussions

Another Python Newb Question

Hi,

 

I try to create a python script which triggers a volume snapshot. I've downloaded the manageability-sdk 9.4 and tried some first steps with the included scripts in the /src/sample/Data_ONTAP/Python folder.

 

After adding

 

import ssl

ssl._create_default_https_context = ssl._create_unverified_context

the "apitest.py" script works.

 

However, the "snapman.py" script won't work when invoked with:

python snap-test.py -l "vserver" "admin" "password" "/vol/V_VM01_INT_0001"

snapshot-list-info failed:Authorization failed

No snapshots on volume /vol/V_VM01_INT_0001

I tried several variations on the call but the result is the same - user/pass works with "apitest.py".

 

 

NetApp Release 9.1P11

 

 

 

python snap-test.py -l "system-manager" "admin" "password" "/vol/V_VM01_INT_0001"
snapshot-list-info failed:Vserver API missing vserver parameter.

No snapshots on volume /vol/V_VM01_INT_0001

 

EDIT:

Same problem like this thread:

https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Please-update-NMSDK-Sample-for-error-13006/m-p/138536

 

 

1 REPLY

Re: Another Python Newb Question

It looks like you are able to connect to the cluster but not to the vserver. In order to perform the vserver level operation you have to connecto vserver. Try this 

 

s = NaServer("cluster-name", 1 , 20)
s.set_server_type("FILER")
s.set_transport_type("HTTP")
s.set_port(80)
s.set_style("LOGIN")
s.set_admin_user("admin", "password")

s.set_vfiler("vserver-name")

 

Attaching ZEDI screenshot which also has option to add vserver

Forums