Python Discussions

Metrocluster switchover with python - is it possible?

iUser

Hi, guys!

 I'm looking a template, or example, to write a simple script that will make a switchover of metrocluster. I'm not sure, if it's possible at all, but maybe somebody have already done such task. Any comments or advises?

2 REPLIES 2

vachagan_gratian

Haven't tried it myself, but look at the "metrocluster-switchover" in the NetApp SDK documentation. I guess something like this should work:

 

import NaServer, NaElement

hostname = ''
username = ''
password = ''

zapi = SDK.NaServer(hostname, 1, 3)                                                                                           
zapi.set_server_type('FILER')                                                                                                       
zapi.set_transport_type('HTTPS')                                                                                                    
zapi.set_style('LOGIN')                                                                                                             
zapi.set_admin_user(username, password)
                                                                                     
request = SDK.NaElement('metrocluster-switchover')                                                                                       
request.child_add_string('simulate', 'true')  

response = zapi.invoke_elem(request)

 

This should simulate a switchover, but I warn again: haven't tried it myself. 

iUser

Thanks for your answer, i'll try to reproduce it in lab!

Announcements
Register for Insight 2021 Digital

INSIGHT 2021 Digital: Meet the Specialists 2

On October 20-22, gear up for a fully digital, totally immersive virtual experience with a downright legendary lineup of world-renowned specialists. Tune in for visionary conversations, solution deep dives, technical sessions and more.

NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public